@atlaskit/smart-card 43.8.1 → 43.9.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 +21 -0
- package/dist/cjs/extractors/flexible/icon/extract-file-formatIcon.js +22 -0
- package/dist/cjs/state/actions/index.js +5 -1
- package/dist/cjs/utils/analytics/analytics.js +1 -1
- package/dist/cjs/utils/window-open-features.js +24 -0
- package/dist/cjs/view/HoverCard/components/CustomPopupContainer.js +25 -2
- package/dist/cjs/view/HoverCard/components/HoverCardComponent.js +16 -5
- package/dist/cjs/view/InlineCard/IconAndTitleLayout/index.js +1 -1
- package/dist/cjs/view/LinkUrl/index.js +1 -1
- package/dist/es2019/extractors/flexible/icon/extract-file-formatIcon.js +22 -0
- package/dist/es2019/state/actions/index.js +5 -1
- package/dist/es2019/utils/analytics/analytics.js +1 -1
- package/dist/es2019/utils/window-open-features.js +18 -0
- package/dist/es2019/view/HoverCard/components/CustomPopupContainer.js +19 -0
- package/dist/es2019/view/HoverCard/components/HoverCardComponent.js +16 -6
- package/dist/es2019/view/InlineCard/IconAndTitleLayout/index.js +1 -1
- package/dist/es2019/view/LinkUrl/index.js +1 -1
- package/dist/esm/extractors/flexible/icon/extract-file-formatIcon.js +22 -0
- package/dist/esm/state/actions/index.js +5 -1
- package/dist/esm/utils/analytics/analytics.js +1 -1
- package/dist/esm/utils/window-open-features.js +18 -0
- package/dist/esm/view/HoverCard/components/CustomPopupContainer.js +24 -1
- package/dist/esm/view/HoverCard/components/HoverCardComponent.js +17 -6
- package/dist/esm/view/InlineCard/IconAndTitleLayout/index.js +1 -1
- package/dist/esm/view/LinkUrl/index.js +1 -1
- package/dist/types/state/modal/index.d.ts +1 -1
- package/dist/types/utils/window-open-features.d.ts +3 -0
- package/dist/types/view/CardWithUrl/component-lazy/LoadingCardLink.d.ts +1 -1
- package/dist/types/view/EmbedModal/components/link-info/link-info-button/index.d.ts +1 -1
- package/dist/types/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/manual-triggers-form/paragraph-prompt/main.d.ts +1 -1
- package/dist/types/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/footer/main.d.ts +1 -1
- package/dist/types/view/FlexibleCard/components/blocks/ai-footer-block/resolved/ai-footer-metadata.d.ts +1 -1
- package/dist/types/view/FlexibleCard/components/common/atlaskit-icon/index.d.ts +1 -1
- package/dist/types/view/FlexibleCard/components/elements/common/base-lozenge-element/lozenge-action/lozenge-action-item/index.d.ts +1 -1
- package/dist/types/view/HoverCard/components/CustomPopupContainer.d.ts +4 -0
- package/dist/types/view/HoverCard/components/HoverCardComponent.d.ts +1 -1
- package/dist/types/view/HoverCard/components/ImagePreview.d.ts +1 -1
- package/dist/types/view/HoverCard/types.d.ts +6 -1
- package/dist/types-ts4.5/state/modal/index.d.ts +1 -1
- package/dist/types-ts4.5/utils/window-open-features.d.ts +3 -0
- package/dist/types-ts4.5/view/CardWithUrl/component-lazy/LoadingCardLink.d.ts +1 -1
- package/dist/types-ts4.5/view/EmbedModal/components/link-info/link-info-button/index.d.ts +1 -1
- package/dist/types-ts4.5/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-container/manual-triggers-form/paragraph-prompt/main.d.ts +1 -1
- package/dist/types-ts4.5/view/FlexibleCard/components/actions/automation-action/automation-manual-triggers/manual-triggers-modal/sub-components/footer/main.d.ts +1 -1
- package/dist/types-ts4.5/view/FlexibleCard/components/blocks/ai-footer-block/resolved/ai-footer-metadata.d.ts +1 -1
- package/dist/types-ts4.5/view/FlexibleCard/components/common/atlaskit-icon/index.d.ts +1 -1
- package/dist/types-ts4.5/view/FlexibleCard/components/elements/common/base-lozenge-element/lozenge-action/lozenge-action-item/index.d.ts +1 -1
- package/dist/types-ts4.5/view/HoverCard/components/CustomPopupContainer.d.ts +4 -0
- package/dist/types-ts4.5/view/HoverCard/components/HoverCardComponent.d.ts +1 -1
- package/dist/types-ts4.5/view/HoverCard/components/ImagePreview.d.ts +1 -1
- package/dist/types-ts4.5/view/HoverCard/types.d.ts +6 -1
- package/package.json +7 -4
|
@@ -4,6 +4,7 @@ var extractFileFormatIcon = function extractFileFormatIcon(fileFormat) {
|
|
|
4
4
|
switch (fileFormat) {
|
|
5
5
|
// Generic documents
|
|
6
6
|
case 'folder':
|
|
7
|
+
// eslint-disable-next-line @atlassian/i18n/no-literal-string-in-object
|
|
7
8
|
return {
|
|
8
9
|
icon: IconType.Folder,
|
|
9
10
|
label: 'Folder'
|
|
@@ -11,44 +12,52 @@ var extractFileFormatIcon = function extractFileFormatIcon(fileFormat) {
|
|
|
11
12
|
case 'text/plain':
|
|
12
13
|
case 'application/vnd.oasis.opendocument.text':
|
|
13
14
|
case 'application/vnd.apple.pages':
|
|
15
|
+
// eslint-disable-next-line @atlassian/i18n/no-literal-string-in-object
|
|
14
16
|
return {
|
|
15
17
|
icon: IconType.Document,
|
|
16
18
|
label: 'Document'
|
|
17
19
|
};
|
|
18
20
|
case 'application/pdf':
|
|
21
|
+
// eslint-disable-next-line @atlassian/i18n/no-literal-string-in-object
|
|
19
22
|
return {
|
|
20
23
|
icon: IconType.PDF,
|
|
21
24
|
label: 'PDF document'
|
|
22
25
|
};
|
|
23
26
|
case 'application/vnd.oasis.opendocument.presentation':
|
|
24
27
|
case 'application/vnd.apple.keynote':
|
|
28
|
+
// eslint-disable-next-line @atlassian/i18n/no-literal-string-in-object
|
|
25
29
|
return {
|
|
26
30
|
icon: IconType.Presentation,
|
|
27
31
|
label: 'Presentation'
|
|
28
32
|
};
|
|
29
33
|
case 'application/vnd.oasis.opendocument.spreadsheet':
|
|
30
34
|
case 'application/vnd.apple.numbers':
|
|
35
|
+
// eslint-disable-next-line @atlassian/i18n/no-literal-string-in-object
|
|
31
36
|
return {
|
|
32
37
|
icon: IconType.Spreadsheet,
|
|
33
38
|
label: 'Spreadsheet'
|
|
34
39
|
};
|
|
35
40
|
// Google Drive
|
|
36
41
|
case 'application/vnd.google-apps.document':
|
|
42
|
+
// eslint-disable-next-line @atlassian/i18n/no-literal-string-in-object
|
|
37
43
|
return {
|
|
38
44
|
icon: IconType.GoogleDocs,
|
|
39
45
|
label: 'Google Docs'
|
|
40
46
|
};
|
|
41
47
|
case 'application/vnd.google-apps.form':
|
|
48
|
+
// eslint-disable-next-line @atlassian/i18n/no-literal-string-in-object
|
|
42
49
|
return {
|
|
43
50
|
icon: IconType.GoogleForms,
|
|
44
51
|
label: 'Google Form'
|
|
45
52
|
};
|
|
46
53
|
case 'application/vnd.google-apps.spreadsheet':
|
|
54
|
+
// eslint-disable-next-line @atlassian/i18n/no-literal-string-in-object
|
|
47
55
|
return {
|
|
48
56
|
icon: IconType.GoogleSheets,
|
|
49
57
|
label: 'Google Sheets'
|
|
50
58
|
};
|
|
51
59
|
case 'application/vnd.google-apps.presentation':
|
|
60
|
+
// eslint-disable-next-line @atlassian/i18n/no-literal-string-in-object
|
|
52
61
|
return {
|
|
53
62
|
icon: IconType.GoogleSlides,
|
|
54
63
|
label: 'Google Slides'
|
|
@@ -56,18 +65,21 @@ var extractFileFormatIcon = function extractFileFormatIcon(fileFormat) {
|
|
|
56
65
|
// Microsoft
|
|
57
66
|
case 'application/vnd.ms-excel':
|
|
58
67
|
case 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet':
|
|
68
|
+
// eslint-disable-next-line @atlassian/i18n/no-literal-string-in-object
|
|
59
69
|
return {
|
|
60
70
|
icon: IconType.MSExcel,
|
|
61
71
|
label: 'Excel spreadsheet'
|
|
62
72
|
};
|
|
63
73
|
case 'application/vnd.ms-powerpoint':
|
|
64
74
|
case 'application/vnd.openxmlformats-officedocument.presentationml.presentation':
|
|
75
|
+
// eslint-disable-next-line @atlassian/i18n/no-literal-string-in-object
|
|
65
76
|
return {
|
|
66
77
|
icon: IconType.MSPowerpoint,
|
|
67
78
|
label: 'PowerPoint presentation'
|
|
68
79
|
};
|
|
69
80
|
case 'application/msword':
|
|
70
81
|
case 'application/vnd.openxmlformats-officedocument.wordprocessingml.document':
|
|
82
|
+
// eslint-disable-next-line @atlassian/i18n/no-literal-string-in-object
|
|
71
83
|
return {
|
|
72
84
|
icon: IconType.MSWord,
|
|
73
85
|
label: 'Word document'
|
|
@@ -77,11 +89,13 @@ var extractFileFormatIcon = function extractFileFormatIcon(fileFormat) {
|
|
|
77
89
|
case 'image/bmp':
|
|
78
90
|
case 'image/webp':
|
|
79
91
|
case 'image/svg+xml':
|
|
92
|
+
// eslint-disable-next-line @atlassian/i18n/no-literal-string-in-object
|
|
80
93
|
return {
|
|
81
94
|
icon: IconType.Image,
|
|
82
95
|
label: 'Image'
|
|
83
96
|
};
|
|
84
97
|
case 'image/gif':
|
|
98
|
+
// eslint-disable-next-line @atlassian/i18n/no-literal-string-in-object
|
|
85
99
|
return {
|
|
86
100
|
icon: IconType.GIF,
|
|
87
101
|
label: 'GIF'
|
|
@@ -91,6 +105,7 @@ var extractFileFormatIcon = function extractFileFormatIcon(fileFormat) {
|
|
|
91
105
|
case 'audio/webm':
|
|
92
106
|
case 'audio/ogg':
|
|
93
107
|
case 'audio/wav':
|
|
108
|
+
// eslint-disable-next-line @atlassian/i18n/no-literal-string-in-object
|
|
94
109
|
return {
|
|
95
110
|
icon: IconType.Audio,
|
|
96
111
|
label: 'Audio'
|
|
@@ -102,6 +117,7 @@ var extractFileFormatIcon = function extractFileFormatIcon(fileFormat) {
|
|
|
102
117
|
case 'video/ogg':
|
|
103
118
|
case 'video/x-ms-wmv':
|
|
104
119
|
case 'video/x-msvideo':
|
|
120
|
+
// eslint-disable-next-line @atlassian/i18n/no-literal-string-in-object
|
|
105
121
|
return {
|
|
106
122
|
icon: IconType.Video,
|
|
107
123
|
label: 'Video'
|
|
@@ -110,6 +126,7 @@ var extractFileFormatIcon = function extractFileFormatIcon(fileFormat) {
|
|
|
110
126
|
case 'text/css':
|
|
111
127
|
case 'text/html':
|
|
112
128
|
case 'application/javascript':
|
|
129
|
+
// eslint-disable-next-line @atlassian/i18n/no-literal-string-in-object
|
|
113
130
|
return {
|
|
114
131
|
icon: IconType.Code,
|
|
115
132
|
label: 'Source Code'
|
|
@@ -120,26 +137,31 @@ var extractFileFormatIcon = function extractFileFormatIcon(fileFormat) {
|
|
|
120
137
|
case 'application/x-7z-compressed':
|
|
121
138
|
case 'application/x-apple-diskimage':
|
|
122
139
|
case 'application/vnd.rar':
|
|
140
|
+
// eslint-disable-next-line @atlassian/i18n/no-literal-string-in-object
|
|
123
141
|
return {
|
|
124
142
|
icon: IconType.Archive,
|
|
125
143
|
label: 'Archive'
|
|
126
144
|
};
|
|
127
145
|
case 'application/dmg':
|
|
146
|
+
// eslint-disable-next-line @atlassian/i18n/no-literal-string-in-object
|
|
128
147
|
return {
|
|
129
148
|
icon: IconType.Executable,
|
|
130
149
|
label: 'Executable'
|
|
131
150
|
};
|
|
132
151
|
case 'application/sketch':
|
|
152
|
+
// eslint-disable-next-line @atlassian/i18n/no-literal-string-in-object
|
|
133
153
|
return {
|
|
134
154
|
icon: IconType.Sketch,
|
|
135
155
|
label: 'Sketch'
|
|
136
156
|
};
|
|
137
157
|
case 'application/octet-stream':
|
|
158
|
+
// eslint-disable-next-line @atlassian/i18n/no-literal-string-in-object
|
|
138
159
|
return {
|
|
139
160
|
icon: IconType.Generic,
|
|
140
161
|
label: 'Binary file'
|
|
141
162
|
};
|
|
142
163
|
case 'application/invision.prototype':
|
|
164
|
+
// eslint-disable-next-line @atlassian/i18n/no-literal-string-in-object
|
|
143
165
|
return {
|
|
144
166
|
icon: IconType.Generic,
|
|
145
167
|
label: 'Prototype'
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
2
2
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
3
3
|
import { useCallback, useMemo } from 'react';
|
|
4
|
+
import FeatureGates from '@atlaskit/feature-gate-js-client';
|
|
4
5
|
import { useSmartLinkContext } from '@atlaskit/link-provider';
|
|
5
6
|
import { ACTION_RESOLVING, ACTION_UPDATE_METADATA_STATUS, cardAction } from '@atlaskit/linking-common';
|
|
6
7
|
import { auth } from '@atlaskit/outbound-auth-flow-client';
|
|
7
8
|
import { useAnalyticsEvents } from '../../common/analytics/generated/use-analytics-events';
|
|
8
9
|
import { SmartLinkStatus } from '../../constants';
|
|
10
|
+
import { AUTH_WINDOW_HEIGHT, AUTH_WINDOW_WIDTH, getWindowOpenFeatures } from '../../utils/window-open-features';
|
|
9
11
|
import { startUfoExperience } from '../analytics';
|
|
10
12
|
import { getByDefinitionId, getDefinitionId, getExtensionKey, getServices } from '../helpers';
|
|
11
13
|
import useInvokeClientAction from '../hooks/use-invoke-client-action';
|
|
@@ -112,7 +114,9 @@ export var useSmartCardActions = function useSmartCardActions(id, url) {
|
|
|
112
114
|
fireEvent('screen.consentModal.viewed', {
|
|
113
115
|
definitionId: definitionId !== null && definitionId !== void 0 ? definitionId : null
|
|
114
116
|
});
|
|
115
|
-
|
|
117
|
+
var shouldShowInPopupWindow = status === 'unauthorized' && FeatureGates.getExperimentValue('platform_sl_3p_auth_window_experiment', 'cohort', 'control') === 'test';
|
|
118
|
+
var windowFeatures = shouldShowInPopupWindow ? getWindowOpenFeatures(AUTH_WINDOW_HEIGHT, AUTH_WINDOW_WIDTH) : undefined;
|
|
119
|
+
auth(services[0].url, windowFeatures).then(function () {
|
|
116
120
|
fireEvent('track.applicationAccount.connected', {
|
|
117
121
|
definitionId: definitionId !== null && definitionId !== void 0 ? definitionId : null
|
|
118
122
|
});
|
|
@@ -4,7 +4,7 @@ export var ANALYTICS_CHANNEL = 'media';
|
|
|
4
4
|
export var context = {
|
|
5
5
|
componentName: 'smart-cards',
|
|
6
6
|
packageName: "@atlaskit/smart-card",
|
|
7
|
-
packageVersion: "
|
|
7
|
+
packageVersion: "0.0.0-development"
|
|
8
8
|
};
|
|
9
9
|
export var TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
10
10
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
var BROWSER_SIZE_THRESHOLD = 38;
|
|
2
|
+
export var AUTH_WINDOW_HEIGHT = 760;
|
|
3
|
+
export var AUTH_WINDOW_WIDTH = 620;
|
|
4
|
+
export var getWindowOpenFeatures = function getWindowOpenFeatures(popupHeight, popupWidth) {
|
|
5
|
+
var vw = Math.max(document.documentElement.clientWidth || 0, window.innerWidth || 0);
|
|
6
|
+
var vh = Math.max(document.documentElement.clientHeight || 0, window.innerHeight || 0);
|
|
7
|
+
var vl = window.screenLeft || 0;
|
|
8
|
+
var vt = window.screenTop || 0;
|
|
9
|
+
|
|
10
|
+
// Center the popup window
|
|
11
|
+
var left = (vw - popupWidth) / 2 + vl;
|
|
12
|
+
var top = (vh - popupHeight) / 2 + vt;
|
|
13
|
+
|
|
14
|
+
// Open a popup if there's enough space in the viewport
|
|
15
|
+
// Otherwise, fall back to the default behavior (opening in a new tab)
|
|
16
|
+
var windowFeatures = vw > popupWidth + BROWSER_SIZE_THRESHOLD && vh > popupHeight + BROWSER_SIZE_THRESHOLD ? "width=".concat(popupWidth, ",height=").concat(popupHeight, ",left=").concat(left, ",top=").concat(top) : undefined;
|
|
17
|
+
return windowFeatures;
|
|
18
|
+
};
|
|
@@ -1,6 +1,10 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
1
2
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
3
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
-
var _excluded = ["children", "shouldFitContainer", "shouldRenderToParent"]
|
|
4
|
+
var _excluded = ["children", "shouldFitContainer", "shouldRenderToParent"],
|
|
5
|
+
_excluded2 = ["children", "shouldFitContainer", "shouldRenderToParent"];
|
|
6
|
+
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; }
|
|
7
|
+
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; }
|
|
4
8
|
import React from 'react';
|
|
5
9
|
/**
|
|
6
10
|
* The purpose of this component is to hide the default Popup border.
|
|
@@ -16,4 +20,23 @@ var CustomPopupContainer = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
16
20
|
ref: ref
|
|
17
21
|
}), children);
|
|
18
22
|
});
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Factory function to create a CustomPopupContainer with a specific z-index
|
|
26
|
+
*/
|
|
27
|
+
export var createCustomPopupContainer = function createCustomPopupContainer(zIndex) {
|
|
28
|
+
return /*#__PURE__*/React.forwardRef(function (_ref2, ref) {
|
|
29
|
+
var children = _ref2.children,
|
|
30
|
+
_ = _ref2.shouldFitContainer,
|
|
31
|
+
__ = _ref2.shouldRenderToParent,
|
|
32
|
+
props = _objectWithoutProperties(_ref2, _excluded2);
|
|
33
|
+
return /*#__PURE__*/React.createElement("div", _extends({}, props, {
|
|
34
|
+
ref: ref
|
|
35
|
+
}, zIndex !== undefined && {
|
|
36
|
+
style: _objectSpread(_objectSpread({}, props.style), {}, {
|
|
37
|
+
zIndex: zIndex
|
|
38
|
+
})
|
|
39
|
+
}), children);
|
|
40
|
+
});
|
|
41
|
+
};
|
|
19
42
|
export default CustomPopupContainer;
|
|
@@ -2,7 +2,7 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
3
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
4
4
|
var _excluded = ["aria-haspopup", "aria-expanded"];
|
|
5
|
-
import React, { useCallback, useEffect, useRef } from 'react';
|
|
5
|
+
import React, { useCallback, useEffect, useMemo, useRef } from 'react';
|
|
6
6
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
7
7
|
import Popup from '@atlaskit/popup';
|
|
8
8
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
@@ -11,7 +11,7 @@ import { useSmartCardActions } from '../../../state/actions';
|
|
|
11
11
|
import { useSmartLinkRenderers } from '../../../state/renderers';
|
|
12
12
|
import { useSmartCardState as useLinkState } from '../../../state/store';
|
|
13
13
|
import { SmartLinkAnalyticsContext } from '../../../utils/analytics/SmartLinkAnalyticsContext';
|
|
14
|
-
import CustomPopupContainer from '../components/CustomPopupContainer';
|
|
14
|
+
import CustomPopupContainer, { createCustomPopupContainer } from '../components/CustomPopupContainer';
|
|
15
15
|
import HoverCardContent from '../components/HoverCardContent';
|
|
16
16
|
import { CARD_GAP_PX, HOVER_CARD_Z_INDEX } from '../styled';
|
|
17
17
|
export var HOVER_CARD_SOURCE = 'smartLinkPreviewHoverCard';
|
|
@@ -38,6 +38,8 @@ export var HoverCardComponent = function HoverCardComponent(_ref) {
|
|
|
38
38
|
noFadeDelay = _ref$noFadeDelay === void 0 ? false : _ref$noFadeDelay,
|
|
39
39
|
hoverPreviewOptions = _ref.hoverPreviewOptions,
|
|
40
40
|
role = _ref.role,
|
|
41
|
+
_ref$shouldRenderToPa = _ref.shouldRenderToParent,
|
|
42
|
+
shouldRenderToParent = _ref$shouldRenderToPa === void 0 ? false : _ref$shouldRenderToPa,
|
|
41
43
|
label = _ref.label,
|
|
42
44
|
titleId = _ref.titleId,
|
|
43
45
|
onVisibilityChange = _ref.onVisibilityChange;
|
|
@@ -235,7 +237,14 @@ export var HoverCardComponent = function HoverCardComponent(_ref) {
|
|
|
235
237
|
className: HOVER_CARD_TRIGGER_WRAPPER
|
|
236
238
|
} : {}), children));
|
|
237
239
|
}, [children, initHideCard, initShowCard, onChildClick, onContextMenuClick, setMousePosition]);
|
|
238
|
-
|
|
240
|
+
var popupComponent = fg('hover-card-prop-should-render-to-parent') ?
|
|
241
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
242
|
+
useMemo(function () {
|
|
243
|
+
// Within the Popup component, if shouldRenderToParent, the zIndex prop is ignored
|
|
244
|
+
// as it is assumed that the custom popup container has the desired styles
|
|
245
|
+
return createCustomPopupContainer(shouldRenderToParent ? zIndex : undefined);
|
|
246
|
+
}, [zIndex, shouldRenderToParent]) : CustomPopupContainer;
|
|
247
|
+
return /*#__PURE__*/React.createElement(Popup, _extends({
|
|
239
248
|
testId: "hover-card",
|
|
240
249
|
isOpen: isOpen && canOpen,
|
|
241
250
|
onClose: hideCard,
|
|
@@ -248,8 +257,10 @@ export var HoverCardComponent = function HoverCardComponent(_ref) {
|
|
|
248
257
|
role: role,
|
|
249
258
|
titleId: titleId,
|
|
250
259
|
label: label
|
|
260
|
+
}, fg('hover-card-prop-should-render-to-parent') ? {
|
|
261
|
+
shouldRenderToParent: shouldRenderToParent
|
|
262
|
+
} : {}, {
|
|
251
263
|
// @ts-ignore: [PIT-1685] Fails in post-office due to backwards incompatibility issue with React 18
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
});
|
|
264
|
+
popupComponent: popupComponent
|
|
265
|
+
}));
|
|
255
266
|
};
|
|
@@ -153,7 +153,7 @@ export var IconAndTitleLayout = function IconAndTitleLayout(_ref2) {
|
|
|
153
153
|
xcss: styles.iconEmptyStyle,
|
|
154
154
|
testId: "icon-empty-wrapper"
|
|
155
155
|
}), /*#__PURE__*/React.createElement("span", {
|
|
156
|
-
"data-
|
|
156
|
+
"data-testid": "icon-wrapper",
|
|
157
157
|
className: ax(["_11c81o8v _2rkolb4i _1e0c116y _kqswstnw _2hwx1b66 _4t3i7vkz _1bsb7vkz _154i1ssb _1ltv1ssb _t9ec1ooe _uiztglyw"])
|
|
158
158
|
}, renderIcon(testId)))), /*#__PURE__*/React.createElement(Box, {
|
|
159
159
|
as: "span",
|
|
@@ -15,7 +15,7 @@ import LinkWarningModal from './LinkWarningModal';
|
|
|
15
15
|
import { useLinkWarningModal } from './LinkWarningModal/hooks/use-link-warning-modal';
|
|
16
16
|
var PACKAGE_DATA = {
|
|
17
17
|
packageName: "@atlaskit/smart-card",
|
|
18
|
-
packageVersion: "
|
|
18
|
+
packageVersion: "0.0.0-development",
|
|
19
19
|
componentName: 'linkUrl'
|
|
20
20
|
};
|
|
21
21
|
var Anchor = withLinkClickedEvent('a');
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { type SmartLinkModalAPI, type SmartLinkModalProviderProps } from './types';
|
|
3
3
|
export declare const SmartLinkModalContext: React.Context<SmartLinkModalAPI>;
|
|
4
|
-
export declare const SmartLinkModalProvider: ({ children }: SmartLinkModalProviderProps) => React.JSX.Element;
|
|
4
|
+
export declare const SmartLinkModalProvider: ({ children, }: SmartLinkModalProviderProps) => React.JSX.Element;
|
|
5
5
|
/**
|
|
6
6
|
* Open (lazy load) modal
|
|
7
7
|
*
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { type CardWithUrlContentProps } from '../types';
|
|
3
|
-
export declare const LoadingCardLink: ({ isSelected, url, placeholder }: CardWithUrlContentProps) => React.JSX.Element;
|
|
3
|
+
export declare const LoadingCardLink: ({ isSelected, url, placeholder, }: CardWithUrlContentProps) => React.JSX.Element;
|
|
@@ -8,5 +8,5 @@ export type LinkInfoButtonProps = {
|
|
|
8
8
|
onClick?: () => void;
|
|
9
9
|
testId?: string;
|
|
10
10
|
};
|
|
11
|
-
declare const LinkInfoButton: ({ content, icon, label, onClick, testId }: LinkInfoButtonProps) => React.JSX.Element;
|
|
11
|
+
declare const LinkInfoButton: ({ content, icon, label, onClick, testId, }: LinkInfoButtonProps) => React.JSX.Element;
|
|
12
12
|
export default LinkInfoButton;
|
|
@@ -3,5 +3,5 @@ import type { UserInputParagraphPrompt } from '../../common/types';
|
|
|
3
3
|
interface ParagraphInputPromptProps {
|
|
4
4
|
userInputPrompt: UserInputParagraphPrompt;
|
|
5
5
|
}
|
|
6
|
-
declare const ParagraphInputPrompt: ({ userInputPrompt }: ParagraphInputPromptProps) => React.JSX.Element;
|
|
6
|
+
declare const ParagraphInputPrompt: ({ userInputPrompt, }: ParagraphInputPromptProps) => React.JSX.Element;
|
|
7
7
|
export default ParagraphInputPrompt;
|
|
@@ -4,5 +4,5 @@ type AutomationModalFooterProps = {
|
|
|
4
4
|
onClose: () => void;
|
|
5
5
|
selectedRule: ManualRule | undefined;
|
|
6
6
|
};
|
|
7
|
-
export declare const AutomationModalFooter: ({ selectedRule, onClose }: AutomationModalFooterProps) => React.JSX.Element | null;
|
|
7
|
+
export declare const AutomationModalFooter: ({ selectedRule, onClose, }: AutomationModalFooterProps) => React.JSX.Element | null;
|
|
8
8
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { AISummaryActionData } from '../../../../../../state/flexible-ui-context/types';
|
|
3
|
-
export declare const AIFooterMetadata: ({ testId, url }: AISummaryActionData & {
|
|
3
|
+
export declare const AIFooterMetadata: ({ testId, url, }: AISummaryActionData & {
|
|
4
4
|
testId?: string;
|
|
5
5
|
}) => React.JSX.Element | null;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { type AtlaskitIconProps } from './types';
|
|
3
|
-
declare const AtlaskitIcon: ({ icon, label, testId, size }: AtlaskitIconProps) => React.JSX.Element | null;
|
|
3
|
+
declare const AtlaskitIcon: ({ icon, label, testId, size, }: AtlaskitIconProps) => React.JSX.Element | null;
|
|
4
4
|
export default AtlaskitIcon;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { LozengeActionItemProps } from './types';
|
|
3
|
-
declare const LozengeActionItem: ({ appearance, id, onClick, testId, text }: LozengeActionItemProps) => React.JSX.Element;
|
|
3
|
+
declare const LozengeActionItem: ({ appearance, id, onClick, testId, text, }: LozengeActionItemProps) => React.JSX.Element;
|
|
4
4
|
export default LozengeActionItem;
|
|
@@ -6,4 +6,8 @@ import { type PopupComponentProps } from '@atlaskit/popup';
|
|
|
6
6
|
* change between the default border and prism border during runtime.
|
|
7
7
|
*/
|
|
8
8
|
declare const CustomPopupContainer: React.ForwardRefExoticComponent<Omit<PopupComponentProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
9
|
+
/**
|
|
10
|
+
* Factory function to create a CustomPopupContainer with a specific z-index
|
|
11
|
+
*/
|
|
12
|
+
export declare const createCustomPopupContainer: (zIndex?: number) => React.ForwardRefExoticComponent<Omit<PopupComponentProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
9
13
|
export default CustomPopupContainer;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { type HoverCardComponentProps } from '../types';
|
|
3
3
|
export declare const HOVER_CARD_SOURCE = "smartLinkPreviewHoverCard";
|
|
4
|
-
export declare const HoverCardComponent: ({ children, url, id, canOpen, closeOnChildClick, actionOptions, allowEventPropagation, zIndex, noFadeDelay, hoverPreviewOptions, role, label, titleId, onVisibilityChange, }: HoverCardComponentProps) => React.JSX.Element;
|
|
4
|
+
export declare const HoverCardComponent: ({ children, url, id, canOpen, closeOnChildClick, actionOptions, allowEventPropagation, zIndex, noFadeDelay, hoverPreviewOptions, role, shouldRenderToParent, label, titleId, onVisibilityChange, }: HoverCardComponentProps) => React.JSX.Element;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { type ImagePreviewProps } from '../types';
|
|
3
|
-
declare const ImagePreview: ({ fallbackElementHeight, response }: ImagePreviewProps) => React.JSX.Element | null;
|
|
3
|
+
declare const ImagePreview: ({ fallbackElementHeight, response, }: ImagePreviewProps) => React.JSX.Element | null;
|
|
4
4
|
export default ImagePreview;
|
|
@@ -51,6 +51,11 @@ export interface HoverCardProps extends WithAnalyticsEventsProps {
|
|
|
51
51
|
* Should be used along with `label` or `titleId` for supported roles.
|
|
52
52
|
*/
|
|
53
53
|
role?: string;
|
|
54
|
+
/**
|
|
55
|
+
* Whether the hover card should render to the parent element, to the
|
|
56
|
+
* atlaskit-portal-container at the root of the document. Defaults to false.
|
|
57
|
+
*/
|
|
58
|
+
shouldRenderToParent?: boolean;
|
|
54
59
|
/**
|
|
55
60
|
* Id referenced by the hover card `aria-labelledby` attribute.
|
|
56
61
|
* Usage of either this, or the `label` attribute is strongly recommended.
|
|
@@ -86,6 +91,7 @@ export interface HoverCardComponentProps extends HoverCardProps, HoverCardIntern
|
|
|
86
91
|
export type HoverCardContentProps = {
|
|
87
92
|
actionOptions?: CardActionOptions;
|
|
88
93
|
cardState: CardState;
|
|
94
|
+
hoverPreviewOptions?: HoverPreviewOptions;
|
|
89
95
|
id?: string;
|
|
90
96
|
onActionClick: (actionId: string | ActionName) => void;
|
|
91
97
|
onMouseEnter?: MouseEventHandler;
|
|
@@ -93,7 +99,6 @@ export type HoverCardContentProps = {
|
|
|
93
99
|
onResolve: () => void;
|
|
94
100
|
renderers?: CardProviderRenderers;
|
|
95
101
|
url: string;
|
|
96
|
-
hoverPreviewOptions?: HoverPreviewOptions;
|
|
97
102
|
};
|
|
98
103
|
export type ContentContainerProps = React.HTMLAttributes<HTMLDivElement> & {
|
|
99
104
|
isAIEnabled?: boolean;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { type SmartLinkModalAPI, type SmartLinkModalProviderProps } from './types';
|
|
3
3
|
export declare const SmartLinkModalContext: React.Context<SmartLinkModalAPI>;
|
|
4
|
-
export declare const SmartLinkModalProvider: ({ children }: SmartLinkModalProviderProps) => React.JSX.Element;
|
|
4
|
+
export declare const SmartLinkModalProvider: ({ children, }: SmartLinkModalProviderProps) => React.JSX.Element;
|
|
5
5
|
/**
|
|
6
6
|
* Open (lazy load) modal
|
|
7
7
|
*
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { type CardWithUrlContentProps } from '../types';
|
|
3
|
-
export declare const LoadingCardLink: ({ isSelected, url, placeholder }: CardWithUrlContentProps) => React.JSX.Element;
|
|
3
|
+
export declare const LoadingCardLink: ({ isSelected, url, placeholder, }: CardWithUrlContentProps) => React.JSX.Element;
|
|
@@ -8,5 +8,5 @@ export type LinkInfoButtonProps = {
|
|
|
8
8
|
onClick?: () => void;
|
|
9
9
|
testId?: string;
|
|
10
10
|
};
|
|
11
|
-
declare const LinkInfoButton: ({ content, icon, label, onClick, testId }: LinkInfoButtonProps) => React.JSX.Element;
|
|
11
|
+
declare const LinkInfoButton: ({ content, icon, label, onClick, testId, }: LinkInfoButtonProps) => React.JSX.Element;
|
|
12
12
|
export default LinkInfoButton;
|
|
@@ -3,5 +3,5 @@ import type { UserInputParagraphPrompt } from '../../common/types';
|
|
|
3
3
|
interface ParagraphInputPromptProps {
|
|
4
4
|
userInputPrompt: UserInputParagraphPrompt;
|
|
5
5
|
}
|
|
6
|
-
declare const ParagraphInputPrompt: ({ userInputPrompt }: ParagraphInputPromptProps) => React.JSX.Element;
|
|
6
|
+
declare const ParagraphInputPrompt: ({ userInputPrompt, }: ParagraphInputPromptProps) => React.JSX.Element;
|
|
7
7
|
export default ParagraphInputPrompt;
|
|
@@ -4,5 +4,5 @@ type AutomationModalFooterProps = {
|
|
|
4
4
|
onClose: () => void;
|
|
5
5
|
selectedRule: ManualRule | undefined;
|
|
6
6
|
};
|
|
7
|
-
export declare const AutomationModalFooter: ({ selectedRule, onClose }: AutomationModalFooterProps) => React.JSX.Element | null;
|
|
7
|
+
export declare const AutomationModalFooter: ({ selectedRule, onClose, }: AutomationModalFooterProps) => React.JSX.Element | null;
|
|
8
8
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { AISummaryActionData } from '../../../../../../state/flexible-ui-context/types';
|
|
3
|
-
export declare const AIFooterMetadata: ({ testId, url }: AISummaryActionData & {
|
|
3
|
+
export declare const AIFooterMetadata: ({ testId, url, }: AISummaryActionData & {
|
|
4
4
|
testId?: string;
|
|
5
5
|
}) => React.JSX.Element | null;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { type AtlaskitIconProps } from './types';
|
|
3
|
-
declare const AtlaskitIcon: ({ icon, label, testId, size }: AtlaskitIconProps) => React.JSX.Element | null;
|
|
3
|
+
declare const AtlaskitIcon: ({ icon, label, testId, size, }: AtlaskitIconProps) => React.JSX.Element | null;
|
|
4
4
|
export default AtlaskitIcon;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { LozengeActionItemProps } from './types';
|
|
3
|
-
declare const LozengeActionItem: ({ appearance, id, onClick, testId, text }: LozengeActionItemProps) => React.JSX.Element;
|
|
3
|
+
declare const LozengeActionItem: ({ appearance, id, onClick, testId, text, }: LozengeActionItemProps) => React.JSX.Element;
|
|
4
4
|
export default LozengeActionItem;
|
|
@@ -6,4 +6,8 @@ import { type PopupComponentProps } from '@atlaskit/popup';
|
|
|
6
6
|
* change between the default border and prism border during runtime.
|
|
7
7
|
*/
|
|
8
8
|
declare const CustomPopupContainer: React.ForwardRefExoticComponent<Omit<PopupComponentProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
9
|
+
/**
|
|
10
|
+
* Factory function to create a CustomPopupContainer with a specific z-index
|
|
11
|
+
*/
|
|
12
|
+
export declare const createCustomPopupContainer: (zIndex?: number) => React.ForwardRefExoticComponent<Omit<PopupComponentProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
9
13
|
export default CustomPopupContainer;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { type HoverCardComponentProps } from '../types';
|
|
3
3
|
export declare const HOVER_CARD_SOURCE = "smartLinkPreviewHoverCard";
|
|
4
|
-
export declare const HoverCardComponent: ({ children, url, id, canOpen, closeOnChildClick, actionOptions, allowEventPropagation, zIndex, noFadeDelay, hoverPreviewOptions, role, label, titleId, onVisibilityChange, }: HoverCardComponentProps) => React.JSX.Element;
|
|
4
|
+
export declare const HoverCardComponent: ({ children, url, id, canOpen, closeOnChildClick, actionOptions, allowEventPropagation, zIndex, noFadeDelay, hoverPreviewOptions, role, shouldRenderToParent, label, titleId, onVisibilityChange, }: HoverCardComponentProps) => React.JSX.Element;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { type ImagePreviewProps } from '../types';
|
|
3
|
-
declare const ImagePreview: ({ fallbackElementHeight, response }: ImagePreviewProps) => React.JSX.Element | null;
|
|
3
|
+
declare const ImagePreview: ({ fallbackElementHeight, response, }: ImagePreviewProps) => React.JSX.Element | null;
|
|
4
4
|
export default ImagePreview;
|
|
@@ -51,6 +51,11 @@ export interface HoverCardProps extends WithAnalyticsEventsProps {
|
|
|
51
51
|
* Should be used along with `label` or `titleId` for supported roles.
|
|
52
52
|
*/
|
|
53
53
|
role?: string;
|
|
54
|
+
/**
|
|
55
|
+
* Whether the hover card should render to the parent element, to the
|
|
56
|
+
* atlaskit-portal-container at the root of the document. Defaults to false.
|
|
57
|
+
*/
|
|
58
|
+
shouldRenderToParent?: boolean;
|
|
54
59
|
/**
|
|
55
60
|
* Id referenced by the hover card `aria-labelledby` attribute.
|
|
56
61
|
* Usage of either this, or the `label` attribute is strongly recommended.
|
|
@@ -86,6 +91,7 @@ export interface HoverCardComponentProps extends HoverCardProps, HoverCardIntern
|
|
|
86
91
|
export type HoverCardContentProps = {
|
|
87
92
|
actionOptions?: CardActionOptions;
|
|
88
93
|
cardState: CardState;
|
|
94
|
+
hoverPreviewOptions?: HoverPreviewOptions;
|
|
89
95
|
id?: string;
|
|
90
96
|
onActionClick: (actionId: string | ActionName) => void;
|
|
91
97
|
onMouseEnter?: MouseEventHandler;
|
|
@@ -93,7 +99,6 @@ export type HoverCardContentProps = {
|
|
|
93
99
|
onResolve: () => void;
|
|
94
100
|
renderers?: CardProviderRenderers;
|
|
95
101
|
url: string;
|
|
96
|
-
hoverPreviewOptions?: HoverPreviewOptions;
|
|
97
102
|
};
|
|
98
103
|
export type ContentContainerProps = React.HTMLAttributes<HTMLDivElement> & {
|
|
99
104
|
isAIEnabled?: boolean;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/smart-card",
|
|
3
|
-
"version": "43.
|
|
3
|
+
"version": "43.9.1",
|
|
4
4
|
"description": "Smart card component",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"@atlaskit/dropdown-menu": "^16.3.0",
|
|
39
39
|
"@atlaskit/embedded-confluence": "^4.3.0",
|
|
40
40
|
"@atlaskit/feature-gate-js-client": "^5.5.0",
|
|
41
|
-
"@atlaskit/form": "^14.
|
|
41
|
+
"@atlaskit/form": "^14.3.0",
|
|
42
42
|
"@atlaskit/frontend-utilities": "^3.2.0",
|
|
43
43
|
"@atlaskit/heading": "^5.2.0",
|
|
44
44
|
"@atlaskit/icon": "^29.0.0",
|
|
@@ -70,8 +70,8 @@
|
|
|
70
70
|
"@atlaskit/textarea": "^8.1.0",
|
|
71
71
|
"@atlaskit/textfield": "^8.1.0",
|
|
72
72
|
"@atlaskit/theme": "^21.0.0",
|
|
73
|
-
"@atlaskit/tmp-editor-statsig": "^13.
|
|
74
|
-
"@atlaskit/tokens": "^8.
|
|
73
|
+
"@atlaskit/tmp-editor-statsig": "^13.40.0",
|
|
74
|
+
"@atlaskit/tokens": "^8.2.0",
|
|
75
75
|
"@atlaskit/tooltip": "^20.10.0",
|
|
76
76
|
"@atlaskit/ufo": "^0.4.0",
|
|
77
77
|
"@babel/runtime": "^7.0.0",
|
|
@@ -235,6 +235,9 @@
|
|
|
235
235
|
"navx-2479-sl-fix-inilne-card-show-connect-button": {
|
|
236
236
|
"type": "boolean"
|
|
237
237
|
},
|
|
238
|
+
"hover-card-prop-should-render-to-parent": {
|
|
239
|
+
"type": "boolean"
|
|
240
|
+
},
|
|
238
241
|
"platform-linking-smart-card-layered-link-a11y": {
|
|
239
242
|
"type": "boolean"
|
|
240
243
|
},
|