@atlaskit/share 3.2.2 → 3.2.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 +18 -0
- package/dist/cjs/components/LazyShareForm/LazyShareForm.js +3 -1
- package/dist/cjs/components/ShareDialogContainer.js +5 -5
- package/dist/cjs/components/ShareDialogWithTrigger.js +5 -8
- package/dist/cjs/components/ShareForm.js +4 -2
- package/dist/cjs/components/UserPickerField.js +4 -2
- package/dist/cjs/components/analytics/analytics.js +1 -1
- package/dist/cjs/components/analytics/ufoExperienceHelper.js +28 -0
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/components/LazyShareForm/LazyShareForm.js +3 -1
- package/dist/es2019/components/ShareDialogContainer.js +4 -5
- package/dist/es2019/components/ShareDialogWithTrigger.js +4 -8
- package/dist/es2019/components/ShareForm.js +4 -2
- package/dist/es2019/components/UserPickerField.js +4 -2
- package/dist/es2019/components/analytics/analytics.js +1 -1
- package/dist/es2019/components/analytics/ufoExperienceHelper.js +19 -0
- package/dist/es2019/version.json +1 -1
- package/dist/esm/clients/AtlassianUrlShortenerClient.js +1 -1
- package/dist/esm/components/LazyShareForm/LazyShareForm.js +3 -1
- package/dist/esm/components/ShareDialogContainer.js +5 -6
- package/dist/esm/components/ShareDialogWithTrigger.js +4 -8
- package/dist/esm/components/ShareForm.js +4 -2
- package/dist/esm/components/UserPickerField.js +4 -2
- package/dist/esm/components/analytics/analytics.js +1 -1
- package/dist/esm/components/analytics/ufoExperienceHelper.js +19 -0
- package/dist/esm/version.json +1 -1
- package/dist/types/components/LazyShareForm/LazyShareForm.d.ts +1 -1
- package/dist/types/components/ShareDialogContainer.d.ts +1 -1
- package/dist/types/components/UserPickerField.d.ts +1 -0
- package/dist/types/components/analytics/ufoExperienceHelper.d.ts +2 -0
- package/dist/types/types/ShareDialogContainer.d.ts +2 -0
- package/dist/types/types/ShareDialogWithTrigger.d.ts +1 -1
- package/dist/types/types/ShareForm.d.ts +1 -1
- package/package.json +7 -7
- package/report.api.md +313 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# @atlaskit/share
|
|
2
2
|
|
|
3
|
+
## 3.2.5
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`0a61837e1ff`](https://bitbucket.org/atlassian/atlassian-frontend/commits/0a61837e1ff) - Bump patch version of smart-user-picker to support right context key for org ID
|
|
8
|
+
|
|
9
|
+
## 3.2.4
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [`facf0749321`](https://bitbucket.org/atlassian/atlassian-frontend/commits/facf0749321) - improve FE analytics by ignoring 401, 403 and 429 status code
|
|
14
|
+
|
|
15
|
+
## 3.2.3
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- [`bde6e3d6be0`](https://bitbucket.org/atlassian/atlassian-frontend/commits/bde6e3d6be0) - Added orgId as an optional prop to Share
|
|
20
|
+
|
|
3
21
|
## 3.2.2
|
|
4
22
|
|
|
5
23
|
### Patch Changes
|
|
@@ -56,7 +56,8 @@ function LazyShareForm(props) {
|
|
|
56
56
|
isSharing = props.isSharing,
|
|
57
57
|
shareError = props.shareError,
|
|
58
58
|
defaultValue = props.defaultValue,
|
|
59
|
-
showTitle = props.showTitle
|
|
59
|
+
showTitle = props.showTitle,
|
|
60
|
+
orgId = props.orgId;
|
|
60
61
|
|
|
61
62
|
var footer = /*#__PURE__*/_react.default.createElement("div", null, bottomMessage ? /*#__PURE__*/_react.default.createElement(_styled.BottomMessageWrapper, null, bottomMessage) : null, customFooter && selectedIntegration === null && /*#__PURE__*/_react.default.createElement(_styled.CustomFooterWrapper, null, customFooter));
|
|
62
63
|
|
|
@@ -94,6 +95,7 @@ function LazyShareForm(props) {
|
|
|
94
95
|
isSharing: isSharing,
|
|
95
96
|
isFetchingConfig: isFetchingConfig,
|
|
96
97
|
isPublicLink: isPublicLink,
|
|
98
|
+
orgId: orgId,
|
|
97
99
|
onSubmit: onSubmit,
|
|
98
100
|
onDismiss: onDismiss,
|
|
99
101
|
onLinkCopy: onLinkCopy,
|
|
@@ -47,6 +47,8 @@ var _i18n = require("../i18n");
|
|
|
47
47
|
|
|
48
48
|
var _analytics = require("./analytics/analytics");
|
|
49
49
|
|
|
50
|
+
var _ufoExperienceHelper = require("./analytics/ufoExperienceHelper");
|
|
51
|
+
|
|
50
52
|
var _ufoExperiences = require("./analytics/ufoExperiences");
|
|
51
53
|
|
|
52
54
|
var _ErrorBoundary = _interopRequireDefault(require("./ErrorBoundary"));
|
|
@@ -155,11 +157,7 @@ var ShareDialogContainerInternal = /*#__PURE__*/function (_React$Component) {
|
|
|
155
157
|
});
|
|
156
158
|
}
|
|
157
159
|
|
|
158
|
-
_ufoExperiences.renderShareDialogExp
|
|
159
|
-
metadata: {
|
|
160
|
-
error: errObj
|
|
161
|
-
}
|
|
162
|
-
});
|
|
160
|
+
(0, _ufoExperienceHelper.isValidFailedExperience)(_ufoExperiences.renderShareDialogExp, errObj);
|
|
163
161
|
|
|
164
162
|
case 15:
|
|
165
163
|
case "end":
|
|
@@ -420,6 +418,7 @@ var ShareDialogContainerInternal = /*#__PURE__*/function (_React$Component) {
|
|
|
420
418
|
value: function render() {
|
|
421
419
|
var _this$props2 = this.props,
|
|
422
420
|
cloudId = _this$props2.cloudId,
|
|
421
|
+
orgId = _this$props2.orgId,
|
|
423
422
|
isAutoOpenDialog = _this$props2.isAutoOpenDialog,
|
|
424
423
|
dialogPlacement = _this$props2.dialogPlacement,
|
|
425
424
|
loadUserOptions = _this$props2.loadUserOptions,
|
|
@@ -476,6 +475,7 @@ var ShareDialogContainerInternal = /*#__PURE__*/function (_React$Component) {
|
|
|
476
475
|
enableSmartUserPicker: enableSmartUserPicker,
|
|
477
476
|
loggedInAccountId: loggedInAccountId,
|
|
478
477
|
cloudId: cloudId,
|
|
478
|
+
orgId: orgId,
|
|
479
479
|
triggerButtonAppearance: triggerButtonAppearance,
|
|
480
480
|
triggerButtonIcon: triggerButtonIcon,
|
|
481
481
|
triggerButtonStyle: triggerButtonStyle,
|
|
@@ -49,6 +49,8 @@ var _types = require("../types");
|
|
|
49
49
|
|
|
50
50
|
var _analytics = require("./analytics/analytics");
|
|
51
51
|
|
|
52
|
+
var _ufoExperienceHelper = require("./analytics/ufoExperienceHelper");
|
|
53
|
+
|
|
52
54
|
var _ufoExperiences = require("./analytics/ufoExperiences");
|
|
53
55
|
|
|
54
56
|
var _lazy = _interopRequireDefault(require("./LazyShareForm/lazy"));
|
|
@@ -309,14 +311,7 @@ var ShareDialogWithTriggerInternal = /*#__PURE__*/function (_React$PureComponent
|
|
|
309
311
|
}
|
|
310
312
|
});
|
|
311
313
|
|
|
312
|
-
_ufoExperiences.shareSubmitExp
|
|
313
|
-
metadata: {
|
|
314
|
-
error: {
|
|
315
|
-
message: err.message,
|
|
316
|
-
name: err.name
|
|
317
|
-
}
|
|
318
|
-
}
|
|
319
|
-
});
|
|
314
|
+
(0, _ufoExperienceHelper.isValidFailedExperience)(_ufoExperiences.shareSubmitExp, err);
|
|
320
315
|
});
|
|
321
316
|
});
|
|
322
317
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "handleFormDismiss", function (data) {
|
|
@@ -471,6 +466,7 @@ var ShareDialogWithTriggerInternal = /*#__PURE__*/function (_React$PureComponent
|
|
|
471
466
|
enableSmartUserPicker = _this$props7.enableSmartUserPicker,
|
|
472
467
|
loggedInAccountId = _this$props7.loggedInAccountId,
|
|
473
468
|
cloudId = _this$props7.cloudId,
|
|
469
|
+
orgId = _this$props7.orgId,
|
|
474
470
|
shareFieldsFooter = _this$props7.shareFieldsFooter,
|
|
475
471
|
onUserSelectionChange = _this$props7.onUserSelectionChange,
|
|
476
472
|
dialogZIndex = _this$props7.dialogZIndex,
|
|
@@ -513,6 +509,7 @@ var ShareDialogWithTriggerInternal = /*#__PURE__*/function (_React$PureComponent
|
|
|
513
509
|
enableSmartUserPicker: enableSmartUserPicker,
|
|
514
510
|
loggedInAccountId: loggedInAccountId,
|
|
515
511
|
cloudId: cloudId,
|
|
512
|
+
orgId: orgId,
|
|
516
513
|
onUserSelectionChange: onUserSelectionChange,
|
|
517
514
|
shareFieldsFooter: shareFieldsFooter,
|
|
518
515
|
isPublicLink: isPublicLink,
|
|
@@ -149,7 +149,8 @@ var InternalForm = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
149
149
|
isDisabled = _this$props.isDisabled,
|
|
150
150
|
isPublicLink = _this$props.isPublicLink,
|
|
151
151
|
copyTooltipText = _this$props.copyTooltipText,
|
|
152
|
-
helperMessage = _this$props.helperMessage
|
|
152
|
+
helperMessage = _this$props.helperMessage,
|
|
153
|
+
orgId = _this$props.orgId;
|
|
153
154
|
return /*#__PURE__*/_react.default.createElement(_analyticsNext.AnalyticsContext, {
|
|
154
155
|
data: {
|
|
155
156
|
source: _analytics.ANALYTICS_SOURCE
|
|
@@ -169,7 +170,8 @@ var InternalForm = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
169
170
|
cloudId: cloudId,
|
|
170
171
|
selectPortalRef: selectPortalRef,
|
|
171
172
|
isPublicLink: isPublicLink,
|
|
172
|
-
helperMessage: helperMessage
|
|
173
|
+
helperMessage: helperMessage,
|
|
174
|
+
orgId: orgId
|
|
173
175
|
})), /*#__PURE__*/_react.default.createElement(FormField, null, /*#__PURE__*/_react.default.createElement(_CommentField.CommentField, {
|
|
174
176
|
defaultValue: defaultValue && defaultValue.comment
|
|
175
177
|
})), fieldsFooter, /*#__PURE__*/_react.default.createElement(FormFooter, null, /*#__PURE__*/_react.default.createElement(_CopyLinkButton.default, {
|
|
@@ -178,14 +178,16 @@ var UserPickerFieldComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
178
178
|
loggedInAccountId = _this$props2.loggedInAccountId,
|
|
179
179
|
cloudId = _this$props2.cloudId,
|
|
180
180
|
selectPortalRef = _this$props2.selectPortalRef,
|
|
181
|
-
isPublicLink = _this$props2.isPublicLink
|
|
181
|
+
isPublicLink = _this$props2.isPublicLink,
|
|
182
|
+
orgId = _this$props2.orgId;
|
|
182
183
|
var smartUserPickerProps = enableSmartUserPicker ? {
|
|
183
184
|
productKey: product,
|
|
184
185
|
principalId: loggedInAccountId,
|
|
185
186
|
siteId: cloudId || '',
|
|
186
187
|
includeTeams: true,
|
|
187
188
|
includeGroups: true,
|
|
188
|
-
debounceTime: DEBOUNCE_MS
|
|
189
|
+
debounceTime: DEBOUNCE_MS,
|
|
190
|
+
orgId: orgId
|
|
189
191
|
} : {};
|
|
190
192
|
var allowEmail = (0, _utils.allowEmails)(config);
|
|
191
193
|
var requiredMessage = getRequiredMessage(product, allowEmail);
|
|
@@ -19,7 +19,7 @@ var buildAttributes = function buildAttributes() {
|
|
|
19
19
|
var attributes = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
20
20
|
return _objectSpread({
|
|
21
21
|
packageName: "@atlaskit/share",
|
|
22
|
-
packageVersion: "3.2.
|
|
22
|
+
packageVersion: "3.2.5"
|
|
23
23
|
}, attributes);
|
|
24
24
|
};
|
|
25
25
|
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.isValidFailedExperience = void 0;
|
|
7
|
+
var ignoredErrorStatusCode = [401, 403, 429];
|
|
8
|
+
|
|
9
|
+
var isValidFailedExperience = function isValidFailedExperience(experience, error) {
|
|
10
|
+
var errorStatusCode = error.code || error.status || error.statusCode;
|
|
11
|
+
|
|
12
|
+
if (ignoredErrorStatusCode.includes(parseInt(errorStatusCode))) {
|
|
13
|
+
experience.abort({
|
|
14
|
+
metadata: {
|
|
15
|
+
error: error
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
experience.failure({
|
|
22
|
+
metadata: {
|
|
23
|
+
error: error
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
exports.isValidFailedExperience = isValidFailedExperience;
|
package/dist/cjs/version.json
CHANGED
|
@@ -45,7 +45,8 @@ function LazyShareForm(props) {
|
|
|
45
45
|
isSharing,
|
|
46
46
|
shareError,
|
|
47
47
|
defaultValue,
|
|
48
|
-
showTitle
|
|
48
|
+
showTitle,
|
|
49
|
+
orgId
|
|
49
50
|
} = props;
|
|
50
51
|
const footer = /*#__PURE__*/React.createElement("div", null, bottomMessage ? /*#__PURE__*/React.createElement(BottomMessageWrapper, null, bottomMessage) : null, customFooter && selectedIntegration === null && /*#__PURE__*/React.createElement(CustomFooterWrapper, null, customFooter));
|
|
51
52
|
return /*#__PURE__*/React.createElement(ShareFormWrapper, {
|
|
@@ -82,6 +83,7 @@ function LazyShareForm(props) {
|
|
|
82
83
|
isSharing: isSharing,
|
|
83
84
|
isFetchingConfig: isFetchingConfig,
|
|
84
85
|
isPublicLink: isPublicLink,
|
|
86
|
+
orgId: orgId,
|
|
85
87
|
onSubmit: onSubmit,
|
|
86
88
|
onDismiss: onDismiss,
|
|
87
89
|
onLinkCopy: onLinkCopy,
|
|
@@ -9,6 +9,7 @@ import { AtlassianUrlShortenerClient } from '../clients/AtlassianUrlShortenerCli
|
|
|
9
9
|
import { ShareServiceClient } from '../clients/ShareServiceClient';
|
|
10
10
|
import { messages } from '../i18n';
|
|
11
11
|
import { CHANNEL_ID, copyLinkButtonClicked, errorEncountered, shortUrlGenerated, shortUrlRequested } from './analytics/analytics';
|
|
12
|
+
import { isValidFailedExperience } from './analytics/ufoExperienceHelper';
|
|
12
13
|
import { renderShareDialogExp } from './analytics/ufoExperiences';
|
|
13
14
|
import ErrorBoundary from './ErrorBoundary';
|
|
14
15
|
import MessagesIntlProvider from './MessagesIntlProvider';
|
|
@@ -83,11 +84,7 @@ export class ShareDialogContainerInternal extends React.Component {
|
|
|
83
84
|
};
|
|
84
85
|
}
|
|
85
86
|
|
|
86
|
-
renderShareDialogExp
|
|
87
|
-
metadata: {
|
|
88
|
-
error: errObj
|
|
89
|
-
}
|
|
90
|
-
});
|
|
87
|
+
isValidFailedExperience(renderShareDialogExp, errObj);
|
|
91
88
|
}
|
|
92
89
|
});
|
|
93
90
|
});
|
|
@@ -327,6 +324,7 @@ export class ShareDialogContainerInternal extends React.Component {
|
|
|
327
324
|
render() {
|
|
328
325
|
const {
|
|
329
326
|
cloudId,
|
|
327
|
+
orgId,
|
|
330
328
|
isAutoOpenDialog,
|
|
331
329
|
dialogPlacement,
|
|
332
330
|
loadUserOptions,
|
|
@@ -385,6 +383,7 @@ export class ShareDialogContainerInternal extends React.Component {
|
|
|
385
383
|
enableSmartUserPicker: enableSmartUserPicker,
|
|
386
384
|
loggedInAccountId: loggedInAccountId,
|
|
387
385
|
cloudId: cloudId,
|
|
386
|
+
orgId: orgId,
|
|
388
387
|
triggerButtonAppearance: triggerButtonAppearance,
|
|
389
388
|
triggerButtonIcon: triggerButtonIcon,
|
|
390
389
|
triggerButtonStyle: triggerButtonStyle,
|
|
@@ -14,6 +14,7 @@ import { OBJECT_SHARED } from '../types';
|
|
|
14
14
|
import { cancelShare, CHANNEL_ID, copyLinkButtonClicked, formShareSubmitted, screenEvent, shareSplitButtonEvent, shareTabClicked, shareTriggerButtonClicked // type TabSubjectIdType,
|
|
15
15
|
} from './analytics/analytics'; // eslint-disable-next-line no-duplicate-imports
|
|
16
16
|
|
|
17
|
+
import { isValidFailedExperience } from './analytics/ufoExperienceHelper';
|
|
17
18
|
import { renderShareDialogExp, shareSubmitExp } from './analytics/ufoExperiences';
|
|
18
19
|
import LazyShareFormLazy from './LazyShareForm/lazy';
|
|
19
20
|
import ShareButton from './ShareButton';
|
|
@@ -259,14 +260,7 @@ export class ShareDialogWithTriggerInternal extends React.PureComponent {
|
|
|
259
260
|
message: err.message
|
|
260
261
|
}
|
|
261
262
|
});
|
|
262
|
-
shareSubmitExp
|
|
263
|
-
metadata: {
|
|
264
|
-
error: {
|
|
265
|
-
message: err.message,
|
|
266
|
-
name: err.name
|
|
267
|
-
}
|
|
268
|
-
}
|
|
269
|
-
});
|
|
263
|
+
isValidFailedExperience(shareSubmitExp, err);
|
|
270
264
|
});
|
|
271
265
|
});
|
|
272
266
|
|
|
@@ -423,6 +417,7 @@ export class ShareDialogWithTriggerInternal extends React.PureComponent {
|
|
|
423
417
|
enableSmartUserPicker,
|
|
424
418
|
loggedInAccountId,
|
|
425
419
|
cloudId,
|
|
420
|
+
orgId,
|
|
426
421
|
shareFieldsFooter,
|
|
427
422
|
onUserSelectionChange,
|
|
428
423
|
dialogZIndex,
|
|
@@ -465,6 +460,7 @@ export class ShareDialogWithTriggerInternal extends React.PureComponent {
|
|
|
465
460
|
enableSmartUserPicker: enableSmartUserPicker,
|
|
466
461
|
loggedInAccountId: loggedInAccountId,
|
|
467
462
|
cloudId: cloudId,
|
|
463
|
+
orgId: orgId,
|
|
468
464
|
onUserSelectionChange: onUserSelectionChange,
|
|
469
465
|
shareFieldsFooter: shareFieldsFooter,
|
|
470
466
|
isPublicLink: isPublicLink,
|
|
@@ -96,7 +96,8 @@ class InternalForm extends React.PureComponent {
|
|
|
96
96
|
isDisabled,
|
|
97
97
|
isPublicLink,
|
|
98
98
|
copyTooltipText,
|
|
99
|
-
helperMessage
|
|
99
|
+
helperMessage,
|
|
100
|
+
orgId
|
|
100
101
|
} = this.props;
|
|
101
102
|
return /*#__PURE__*/React.createElement(AnalyticsContext, {
|
|
102
103
|
data: {
|
|
@@ -117,7 +118,8 @@ class InternalForm extends React.PureComponent {
|
|
|
117
118
|
cloudId: cloudId,
|
|
118
119
|
selectPortalRef: selectPortalRef,
|
|
119
120
|
isPublicLink: isPublicLink,
|
|
120
|
-
helperMessage: helperMessage
|
|
121
|
+
helperMessage: helperMessage,
|
|
122
|
+
orgId: orgId
|
|
121
123
|
})), /*#__PURE__*/React.createElement(FormField, null, /*#__PURE__*/React.createElement(CommentField, {
|
|
122
124
|
defaultValue: defaultValue && defaultValue.comment
|
|
123
125
|
})), fieldsFooter, /*#__PURE__*/React.createElement(FormFooter, null, /*#__PURE__*/React.createElement(CopyLinkButton, {
|
|
@@ -121,7 +121,8 @@ export class UserPickerFieldComponent extends React.Component {
|
|
|
121
121
|
loggedInAccountId,
|
|
122
122
|
cloudId,
|
|
123
123
|
selectPortalRef,
|
|
124
|
-
isPublicLink
|
|
124
|
+
isPublicLink,
|
|
125
|
+
orgId
|
|
125
126
|
} = this.props;
|
|
126
127
|
const smartUserPickerProps = enableSmartUserPicker ? {
|
|
127
128
|
productKey: product,
|
|
@@ -129,7 +130,8 @@ export class UserPickerFieldComponent extends React.Component {
|
|
|
129
130
|
siteId: cloudId || '',
|
|
130
131
|
includeTeams: true,
|
|
131
132
|
includeGroups: true,
|
|
132
|
-
debounceTime: DEBOUNCE_MS
|
|
133
|
+
debounceTime: DEBOUNCE_MS,
|
|
134
|
+
orgId
|
|
133
135
|
} : {};
|
|
134
136
|
const allowEmail = allowEmails(config);
|
|
135
137
|
const requiredMessage = getRequiredMessage(product, allowEmail);
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
const ignoredErrorStatusCode = [401, 403, 429];
|
|
2
|
+
export const isValidFailedExperience = (experience, error) => {
|
|
3
|
+
const errorStatusCode = error.code || error.status || error.statusCode;
|
|
4
|
+
|
|
5
|
+
if (ignoredErrorStatusCode.includes(parseInt(errorStatusCode))) {
|
|
6
|
+
experience.abort({
|
|
7
|
+
metadata: {
|
|
8
|
+
error
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
return;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
experience.failure({
|
|
15
|
+
metadata: {
|
|
16
|
+
error
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
};
|
package/dist/es2019/version.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
2
1
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
3
2
|
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
4
3
|
import _createClass from "@babel/runtime/helpers/createClass";
|
|
4
|
+
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
5
5
|
export var AtlassianUrlShortenerClient = /*#__PURE__*/function () {
|
|
6
6
|
function AtlassianUrlShortenerClient() {
|
|
7
7
|
_classCallCheck(this, AtlassianUrlShortenerClient);
|
|
@@ -41,7 +41,8 @@ function LazyShareForm(props) {
|
|
|
41
41
|
isSharing = props.isSharing,
|
|
42
42
|
shareError = props.shareError,
|
|
43
43
|
defaultValue = props.defaultValue,
|
|
44
|
-
showTitle = props.showTitle
|
|
44
|
+
showTitle = props.showTitle,
|
|
45
|
+
orgId = props.orgId;
|
|
45
46
|
var footer = /*#__PURE__*/React.createElement("div", null, bottomMessage ? /*#__PURE__*/React.createElement(BottomMessageWrapper, null, bottomMessage) : null, customFooter && selectedIntegration === null && /*#__PURE__*/React.createElement(CustomFooterWrapper, null, customFooter));
|
|
46
47
|
return /*#__PURE__*/React.createElement(ShareFormWrapper, {
|
|
47
48
|
footer: footer // form title will be determined by `title` and `showTitle` prop passed to `ShareForm`,
|
|
@@ -77,6 +78,7 @@ function LazyShareForm(props) {
|
|
|
77
78
|
isSharing: isSharing,
|
|
78
79
|
isFetchingConfig: isFetchingConfig,
|
|
79
80
|
isPublicLink: isPublicLink,
|
|
81
|
+
orgId: orgId,
|
|
80
82
|
onSubmit: onSubmit,
|
|
81
83
|
onDismiss: onDismiss,
|
|
82
84
|
onLinkCopy: onLinkCopy,
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
2
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
3
2
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
4
3
|
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
@@ -8,6 +7,7 @@ import _inherits from "@babel/runtime/helpers/inherits";
|
|
|
8
7
|
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
9
8
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
10
9
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
10
|
+
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
11
11
|
|
|
12
12
|
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; }
|
|
13
13
|
|
|
@@ -27,6 +27,7 @@ import { AtlassianUrlShortenerClient } from '../clients/AtlassianUrlShortenerCli
|
|
|
27
27
|
import { ShareServiceClient } from '../clients/ShareServiceClient';
|
|
28
28
|
import { messages } from '../i18n';
|
|
29
29
|
import { CHANNEL_ID, copyLinkButtonClicked, errorEncountered, shortUrlGenerated, shortUrlRequested } from './analytics/analytics';
|
|
30
|
+
import { isValidFailedExperience } from './analytics/ufoExperienceHelper';
|
|
30
31
|
import { renderShareDialogExp } from './analytics/ufoExperiences';
|
|
31
32
|
import ErrorBoundary from './ErrorBoundary';
|
|
32
33
|
import MessagesIntlProvider from './MessagesIntlProvider';
|
|
@@ -123,11 +124,7 @@ export var ShareDialogContainerInternal = /*#__PURE__*/function (_React$Componen
|
|
|
123
124
|
});
|
|
124
125
|
}
|
|
125
126
|
|
|
126
|
-
renderShareDialogExp
|
|
127
|
-
metadata: {
|
|
128
|
-
error: errObj
|
|
129
|
-
}
|
|
130
|
-
});
|
|
127
|
+
isValidFailedExperience(renderShareDialogExp, errObj);
|
|
131
128
|
|
|
132
129
|
case 15:
|
|
133
130
|
case "end":
|
|
@@ -396,6 +393,7 @@ export var ShareDialogContainerInternal = /*#__PURE__*/function (_React$Componen
|
|
|
396
393
|
value: function render() {
|
|
397
394
|
var _this$props2 = this.props,
|
|
398
395
|
cloudId = _this$props2.cloudId,
|
|
396
|
+
orgId = _this$props2.orgId,
|
|
399
397
|
isAutoOpenDialog = _this$props2.isAutoOpenDialog,
|
|
400
398
|
dialogPlacement = _this$props2.dialogPlacement,
|
|
401
399
|
loadUserOptions = _this$props2.loadUserOptions,
|
|
@@ -452,6 +450,7 @@ export var ShareDialogContainerInternal = /*#__PURE__*/function (_React$Componen
|
|
|
452
450
|
enableSmartUserPicker: enableSmartUserPicker,
|
|
453
451
|
loggedInAccountId: loggedInAccountId,
|
|
454
452
|
cloudId: cloudId,
|
|
453
|
+
orgId: orgId,
|
|
455
454
|
triggerButtonAppearance: triggerButtonAppearance,
|
|
456
455
|
triggerButtonIcon: triggerButtonIcon,
|
|
457
456
|
triggerButtonStyle: triggerButtonStyle,
|
|
@@ -32,6 +32,7 @@ import { OBJECT_SHARED } from '../types';
|
|
|
32
32
|
import { cancelShare, CHANNEL_ID, copyLinkButtonClicked, formShareSubmitted, screenEvent, shareSplitButtonEvent, shareTabClicked, shareTriggerButtonClicked // type TabSubjectIdType,
|
|
33
33
|
} from './analytics/analytics'; // eslint-disable-next-line no-duplicate-imports
|
|
34
34
|
|
|
35
|
+
import { isValidFailedExperience } from './analytics/ufoExperienceHelper';
|
|
35
36
|
import { renderShareDialogExp, shareSubmitExp } from './analytics/ufoExperiences';
|
|
36
37
|
import LazyShareFormLazy from './LazyShareForm/lazy';
|
|
37
38
|
import ShareButton from './ShareButton';
|
|
@@ -286,14 +287,7 @@ export var ShareDialogWithTriggerInternal = /*#__PURE__*/function (_React$PureCo
|
|
|
286
287
|
}
|
|
287
288
|
});
|
|
288
289
|
|
|
289
|
-
shareSubmitExp
|
|
290
|
-
metadata: {
|
|
291
|
-
error: {
|
|
292
|
-
message: err.message,
|
|
293
|
-
name: err.name
|
|
294
|
-
}
|
|
295
|
-
}
|
|
296
|
-
});
|
|
290
|
+
isValidFailedExperience(shareSubmitExp, err);
|
|
297
291
|
});
|
|
298
292
|
});
|
|
299
293
|
|
|
@@ -455,6 +449,7 @@ export var ShareDialogWithTriggerInternal = /*#__PURE__*/function (_React$PureCo
|
|
|
455
449
|
enableSmartUserPicker = _this$props7.enableSmartUserPicker,
|
|
456
450
|
loggedInAccountId = _this$props7.loggedInAccountId,
|
|
457
451
|
cloudId = _this$props7.cloudId,
|
|
452
|
+
orgId = _this$props7.orgId,
|
|
458
453
|
shareFieldsFooter = _this$props7.shareFieldsFooter,
|
|
459
454
|
onUserSelectionChange = _this$props7.onUserSelectionChange,
|
|
460
455
|
dialogZIndex = _this$props7.dialogZIndex,
|
|
@@ -497,6 +492,7 @@ export var ShareDialogWithTriggerInternal = /*#__PURE__*/function (_React$PureCo
|
|
|
497
492
|
enableSmartUserPicker: enableSmartUserPicker,
|
|
498
493
|
loggedInAccountId: loggedInAccountId,
|
|
499
494
|
cloudId: cloudId,
|
|
495
|
+
orgId: orgId,
|
|
500
496
|
onUserSelectionChange: onUserSelectionChange,
|
|
501
497
|
shareFieldsFooter: shareFieldsFooter,
|
|
502
498
|
isPublicLink: isPublicLink,
|
|
@@ -98,7 +98,8 @@ var InternalForm = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
98
98
|
isDisabled = _this$props.isDisabled,
|
|
99
99
|
isPublicLink = _this$props.isPublicLink,
|
|
100
100
|
copyTooltipText = _this$props.copyTooltipText,
|
|
101
|
-
helperMessage = _this$props.helperMessage
|
|
101
|
+
helperMessage = _this$props.helperMessage,
|
|
102
|
+
orgId = _this$props.orgId;
|
|
102
103
|
return /*#__PURE__*/React.createElement(AnalyticsContext, {
|
|
103
104
|
data: {
|
|
104
105
|
source: ANALYTICS_SOURCE
|
|
@@ -118,7 +119,8 @@ var InternalForm = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
118
119
|
cloudId: cloudId,
|
|
119
120
|
selectPortalRef: selectPortalRef,
|
|
120
121
|
isPublicLink: isPublicLink,
|
|
121
|
-
helperMessage: helperMessage
|
|
122
|
+
helperMessage: helperMessage,
|
|
123
|
+
orgId: orgId
|
|
122
124
|
})), /*#__PURE__*/React.createElement(FormField, null, /*#__PURE__*/React.createElement(CommentField, {
|
|
123
125
|
defaultValue: defaultValue && defaultValue.comment
|
|
124
126
|
})), fieldsFooter, /*#__PURE__*/React.createElement(FormFooter, null, /*#__PURE__*/React.createElement(CopyLinkButton, {
|
|
@@ -151,14 +151,16 @@ export var UserPickerFieldComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
151
151
|
loggedInAccountId = _this$props2.loggedInAccountId,
|
|
152
152
|
cloudId = _this$props2.cloudId,
|
|
153
153
|
selectPortalRef = _this$props2.selectPortalRef,
|
|
154
|
-
isPublicLink = _this$props2.isPublicLink
|
|
154
|
+
isPublicLink = _this$props2.isPublicLink,
|
|
155
|
+
orgId = _this$props2.orgId;
|
|
155
156
|
var smartUserPickerProps = enableSmartUserPicker ? {
|
|
156
157
|
productKey: product,
|
|
157
158
|
principalId: loggedInAccountId,
|
|
158
159
|
siteId: cloudId || '',
|
|
159
160
|
includeTeams: true,
|
|
160
161
|
includeGroups: true,
|
|
161
|
-
debounceTime: DEBOUNCE_MS
|
|
162
|
+
debounceTime: DEBOUNCE_MS,
|
|
163
|
+
orgId: orgId
|
|
162
164
|
} : {};
|
|
163
165
|
var allowEmail = allowEmails(config);
|
|
164
166
|
var requiredMessage = getRequiredMessage(product, allowEmail);
|
|
@@ -10,7 +10,7 @@ var buildAttributes = function buildAttributes() {
|
|
|
10
10
|
var attributes = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
11
11
|
return _objectSpread({
|
|
12
12
|
packageName: "@atlaskit/share",
|
|
13
|
-
packageVersion: "3.2.
|
|
13
|
+
packageVersion: "3.2.5"
|
|
14
14
|
}, attributes);
|
|
15
15
|
};
|
|
16
16
|
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
var ignoredErrorStatusCode = [401, 403, 429];
|
|
2
|
+
export var isValidFailedExperience = function isValidFailedExperience(experience, error) {
|
|
3
|
+
var errorStatusCode = error.code || error.status || error.statusCode;
|
|
4
|
+
|
|
5
|
+
if (ignoredErrorStatusCode.includes(parseInt(errorStatusCode))) {
|
|
6
|
+
experience.abort({
|
|
7
|
+
metadata: {
|
|
8
|
+
error: error
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
return;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
experience.failure({
|
|
15
|
+
metadata: {
|
|
16
|
+
error: error
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
};
|
package/dist/esm/version.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import type { LoadOptions } from '@atlaskit/smart-user-picker';
|
|
3
3
|
import type { ShareData, ShareDialogWithTriggerProps, ShareDialogWithTriggerStates } from '../../types';
|
|
4
4
|
import { IntegrationFormProps } from '../IntegrationForm';
|
|
5
|
-
export declare type LazyShareFormProps = Pick<ShareDialogWithTriggerProps, 'copyLink' | 'config' | 'isFetchingConfig' | 'loadUserOptions' | 'shareFormTitle' | 'shareFormHelperMessage' | 'bottomMessage' | 'submitButtonLabel' | 'product' | 'customFooter' | 'enableSmartUserPicker' | 'loggedInAccountId' | 'cloudId' | 'shareFieldsFooter' | 'onUserSelectionChange' | 'isPublicLink' | 'copyTooltipText' | 'shareIntegrations' | 'integrationMode' | 'onDialogClose'> & Pick<ShareDialogWithTriggerStates, 'showIntegrationForm' | 'selectedIntegration' | 'isSharing' | 'shareError' | 'defaultValue'> & Pick<IntegrationFormProps, 'Content'> & {
|
|
5
|
+
export declare type LazyShareFormProps = Pick<ShareDialogWithTriggerProps, 'copyLink' | 'config' | 'isFetchingConfig' | 'loadUserOptions' | 'shareFormTitle' | 'shareFormHelperMessage' | 'bottomMessage' | 'submitButtonLabel' | 'product' | 'customFooter' | 'enableSmartUserPicker' | 'loggedInAccountId' | 'cloudId' | 'shareFieldsFooter' | 'onUserSelectionChange' | 'isPublicLink' | 'copyTooltipText' | 'shareIntegrations' | 'integrationMode' | 'onDialogClose' | 'orgId'> & Pick<ShareDialogWithTriggerStates, 'showIntegrationForm' | 'selectedIntegration' | 'isSharing' | 'shareError' | 'defaultValue'> & Pick<IntegrationFormProps, 'Content'> & {
|
|
6
6
|
onLinkCopy: () => void;
|
|
7
7
|
onDismiss: (data: ShareData) => void;
|
|
8
8
|
onSubmit: (data: ShareData) => void;
|
|
@@ -52,7 +52,7 @@ export declare class ShareDialogContainerInternal extends React.Component<WithAn
|
|
|
52
52
|
getFormShareLink: () => string;
|
|
53
53
|
render(): JSX.Element;
|
|
54
54
|
}
|
|
55
|
-
export declare const ShareDialogContainer: React.ForwardRefExoticComponent<Pick<Omit<WithAnalyticsEventsProps & ShareDialogContainerProps, keyof WithAnalyticsEventsProps>, "onTriggerButtonClick" | "isAutoOpenDialog" | "shouldCloseOnEscapePress" | "dialogPlacement" | "loadUserOptions" | "onDialogOpen" | "onDialogClose" | "onUserSelectionChange" | "renderCustomTriggerButton" | "shareContentType" | "shareFormTitle" | "shareFormHelperMessage" | "showFlags" | "loggedInAccountId" | "triggerButtonAppearance" | "triggerButtonIcon" | "triggerButtonStyle" | "triggerButtonTooltipPosition" | "triggerButtonTooltipText" | "cloudId" | "bottomMessage" | "customFooter" | "isCopyDisabled" | "isPublicLink" | "integrationMode" | "shareFieldsFooter" | "shareIntegrations" | "shareAri" | "tabIndex" | "copyTooltipText" | "dialogZIndex" | "shareClient" | "urlShortenerClient" | "shortLinkData" | "formatCopyLink" | "originTracingFactory" | "productId" | "shareLink" | "shareTitle" | "useUrlShortener"> & Partial<Pick<Omit<WithAnalyticsEventsProps & ShareDialogContainerProps, keyof WithAnalyticsEventsProps>, "enableSmartUserPicker" | "product" | "shareeAction">> & Partial<Pick<{
|
|
55
|
+
export declare const ShareDialogContainer: React.ForwardRefExoticComponent<Pick<Omit<WithAnalyticsEventsProps & ShareDialogContainerProps, keyof WithAnalyticsEventsProps>, "onTriggerButtonClick" | "isAutoOpenDialog" | "shouldCloseOnEscapePress" | "dialogPlacement" | "loadUserOptions" | "onDialogOpen" | "onDialogClose" | "onUserSelectionChange" | "renderCustomTriggerButton" | "shareContentType" | "shareFormTitle" | "shareFormHelperMessage" | "showFlags" | "loggedInAccountId" | "triggerButtonAppearance" | "triggerButtonIcon" | "triggerButtonStyle" | "triggerButtonTooltipPosition" | "triggerButtonTooltipText" | "cloudId" | "bottomMessage" | "customFooter" | "isCopyDisabled" | "isPublicLink" | "integrationMode" | "shareFieldsFooter" | "shareIntegrations" | "shareAri" | "tabIndex" | "copyTooltipText" | "dialogZIndex" | "orgId" | "shareClient" | "urlShortenerClient" | "shortLinkData" | "formatCopyLink" | "originTracingFactory" | "productId" | "shareLink" | "shareTitle" | "useUrlShortener"> & Partial<Pick<Omit<WithAnalyticsEventsProps & ShareDialogContainerProps, keyof WithAnalyticsEventsProps>, "enableSmartUserPicker" | "product" | "shareeAction">> & Partial<Pick<{
|
|
56
56
|
enableSmartUserPicker: boolean;
|
|
57
57
|
shareeAction: "view" | "edit";
|
|
58
58
|
product: string;
|
|
@@ -17,6 +17,7 @@ export declare type Props = {
|
|
|
17
17
|
selectPortalRef?: React.Ref<HTMLDivElement>;
|
|
18
18
|
isPublicLink?: boolean;
|
|
19
19
|
helperMessage?: string;
|
|
20
|
+
orgId?: string;
|
|
20
21
|
};
|
|
21
22
|
export declare class UserPickerFieldComponent extends React.Component<WrappedComponentProps & Props> {
|
|
22
23
|
private loadOptions;
|
|
@@ -28,6 +28,8 @@ export declare type ShareDialogContainerProps = {
|
|
|
28
28
|
/** Cloud ID of the instance.
|
|
29
29
|
* Note: we assume this props is stable. */
|
|
30
30
|
cloudId: string;
|
|
31
|
+
/** Organisation ID of the instance. */
|
|
32
|
+
orgId?: string;
|
|
31
33
|
/** Placement of the modal to the trigger button. */
|
|
32
34
|
dialogPlacement?: DialogPlacement;
|
|
33
35
|
/**
|
|
@@ -19,7 +19,7 @@ export declare type DialogPlacement = Placement;
|
|
|
19
19
|
* with the demo page and clearly visible options on that page.
|
|
20
20
|
*/
|
|
21
21
|
export declare type DialogBoundariesElement = 'viewport' | 'window' | 'scrollParent';
|
|
22
|
-
export declare type ShareDialogWithTriggerProps = Pick<ShareDialogContainerProps, 'onTriggerButtonClick' | 'isAutoOpenDialog' | 'shouldCloseOnEscapePress' | 'dialogPlacement' | 'loadUserOptions' | 'onDialogOpen' | 'onDialogClose' | 'onUserSelectionChange' | 'renderCustomTriggerButton' | 'shareContentType' | 'shareFormTitle' | 'shareFormHelperMessage' | 'showFlags' | 'enableSmartUserPicker' | 'loggedInAccountId' | 'triggerButtonAppearance' | 'triggerButtonIcon' | 'triggerButtonStyle' | 'triggerButtonTooltipPosition' | 'triggerButtonTooltipText' | 'cloudId' | 'bottomMessage' | 'product' | 'customFooter' | 'isCopyDisabled' | 'isPublicLink' | 'integrationMode' | 'shareFieldsFooter' | 'shareIntegrations' | 'shareAri' | 'tabIndex' | 'copyTooltipText' | 'dialogZIndex'> & {
|
|
22
|
+
export declare type ShareDialogWithTriggerProps = Pick<ShareDialogContainerProps, 'onTriggerButtonClick' | 'isAutoOpenDialog' | 'shouldCloseOnEscapePress' | 'dialogPlacement' | 'loadUserOptions' | 'onDialogOpen' | 'onDialogClose' | 'onUserSelectionChange' | 'renderCustomTriggerButton' | 'shareContentType' | 'shareFormTitle' | 'shareFormHelperMessage' | 'showFlags' | 'enableSmartUserPicker' | 'loggedInAccountId' | 'triggerButtonAppearance' | 'triggerButtonIcon' | 'triggerButtonStyle' | 'triggerButtonTooltipPosition' | 'triggerButtonTooltipText' | 'cloudId' | 'bottomMessage' | 'product' | 'customFooter' | 'isCopyDisabled' | 'isPublicLink' | 'integrationMode' | 'shareFieldsFooter' | 'shareIntegrations' | 'shareAri' | 'tabIndex' | 'copyTooltipText' | 'dialogZIndex' | 'orgId'> & {
|
|
23
23
|
config?: ConfigResponse;
|
|
24
24
|
isFetchingConfig?: boolean;
|
|
25
25
|
children?: RenderCustomTriggerButton;
|
|
@@ -4,7 +4,7 @@ import type { ConfigResponse } from '../clients/ShareServiceClient';
|
|
|
4
4
|
import type { ProductName } from './Products';
|
|
5
5
|
import type { ShareData, ShareError } from './ShareContentState';
|
|
6
6
|
import type { ShareDialogContainerProps } from './ShareDialogContainer';
|
|
7
|
-
export declare type ShareFormProps = Pick<ShareDialogContainerProps, 'integrationMode' | 'shareIntegrations' | 'copyTooltipText' | 'isPublicLink' | 'onUserSelectionChange' | 'cloudId' | 'loggedInAccountId' | 'enableSmartUserPicker'> & {
|
|
7
|
+
export declare type ShareFormProps = Pick<ShareDialogContainerProps, 'integrationMode' | 'shareIntegrations' | 'copyTooltipText' | 'isPublicLink' | 'onUserSelectionChange' | 'cloudId' | 'loggedInAccountId' | 'enableSmartUserPicker' | 'orgId'> & {
|
|
8
8
|
config?: ConfigResponse;
|
|
9
9
|
isFetchingConfig?: boolean;
|
|
10
10
|
copyLink: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/share",
|
|
3
|
-
"version": "3.2.
|
|
3
|
+
"version": "3.2.5",
|
|
4
4
|
"description": "Fabric Share Element",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -32,12 +32,12 @@
|
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"@atlaskit/analytics-next": "^8.2.0",
|
|
34
34
|
"@atlaskit/button": "^16.3.0",
|
|
35
|
-
"@atlaskit/dropdown-menu": "^11.
|
|
35
|
+
"@atlaskit/dropdown-menu": "^11.2.0",
|
|
36
36
|
"@atlaskit/form": "^8.5.0",
|
|
37
37
|
"@atlaskit/icon": "^21.10.0",
|
|
38
38
|
"@atlaskit/popup": "^1.3.0",
|
|
39
39
|
"@atlaskit/portal": "^4.0.0",
|
|
40
|
-
"@atlaskit/smart-user-picker": "^5.
|
|
40
|
+
"@atlaskit/smart-user-picker": "^5.1.2",
|
|
41
41
|
"@atlaskit/spinner": "^15.1.4",
|
|
42
42
|
"@atlaskit/tabs": "^13.2.3",
|
|
43
43
|
"@atlaskit/textarea": "^4.3.0",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"@atlaskit/tokens": "^0.10.0",
|
|
46
46
|
"@atlaskit/tooltip": "^17.5.0",
|
|
47
47
|
"@atlaskit/ufo": "^0.1.0",
|
|
48
|
-
"@atlaskit/user-picker": "^9.
|
|
48
|
+
"@atlaskit/user-picker": "^9.2.0",
|
|
49
49
|
"@atlaskit/util-service-support": "^6.1.0",
|
|
50
50
|
"@babel/runtime": "^7.0.0",
|
|
51
51
|
"fast-deep-equal": "^3.1.1",
|
|
@@ -61,11 +61,11 @@
|
|
|
61
61
|
"devDependencies": {
|
|
62
62
|
"@atlaskit/docs": "^9.0.0",
|
|
63
63
|
"@atlaskit/editor-test-helpers": "^17.0.0",
|
|
64
|
-
"@atlaskit/flag": "^14.
|
|
64
|
+
"@atlaskit/flag": "^14.6.0",
|
|
65
65
|
"@atlaskit/section-message": "^6.0.0",
|
|
66
|
-
"@atlaskit/select": "^15.
|
|
66
|
+
"@atlaskit/select": "^15.3.0",
|
|
67
67
|
"@atlaskit/toggle": "^12.4.0",
|
|
68
|
-
"@atlaskit/util-data-test": "^17.
|
|
68
|
+
"@atlaskit/util-data-test": "^17.3.0",
|
|
69
69
|
"@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",
|
|
70
70
|
"enzyme": "^3.10.0",
|
|
71
71
|
"enzyme-adapter-react-16": "^1.15.1",
|
package/report.api.md
ADDED
|
@@ -0,0 +1,313 @@
|
|
|
1
|
+
## API Report File for "@atlaskit/share"
|
|
2
|
+
|
|
3
|
+
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
|
|
4
|
+
|
|
5
|
+
```ts
|
|
6
|
+
/// <reference types="react" />
|
|
7
|
+
|
|
8
|
+
import type { Appearance } from '@atlaskit/button/types';
|
|
9
|
+
import type { IconProps } from '@atlaskit/icon';
|
|
10
|
+
import type { LoadOptions } from '@atlaskit/smart-user-picker';
|
|
11
|
+
import { OptionData } from '@atlaskit/smart-user-picker';
|
|
12
|
+
import type { Placement } from '@atlaskit/popper';
|
|
13
|
+
import { default as React_2 } from 'react';
|
|
14
|
+
import type { TriggerProps } from '@atlaskit/popup';
|
|
15
|
+
import type { Value } from '@atlaskit/smart-user-picker';
|
|
16
|
+
import { WithAnalyticsEventsProps } from '@atlaskit/analytics-next';
|
|
17
|
+
|
|
18
|
+
// @public (undocumented)
|
|
19
|
+
export const ADMIN_NOTIFIED = 'admin-notified';
|
|
20
|
+
|
|
21
|
+
// @public (undocumented)
|
|
22
|
+
type Comment_2 = {
|
|
23
|
+
format: 'plain_text' | 'adf';
|
|
24
|
+
value: string;
|
|
25
|
+
};
|
|
26
|
+
export { Comment_2 as Comment };
|
|
27
|
+
|
|
28
|
+
// @public (undocumented)
|
|
29
|
+
export type ConfigResponse = {
|
|
30
|
+
disableSharingToEmails?: boolean;
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
// @public (undocumented)
|
|
34
|
+
export type Content = {
|
|
35
|
+
ari: string;
|
|
36
|
+
link: string;
|
|
37
|
+
title: string;
|
|
38
|
+
type: string;
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
// @public (undocumented)
|
|
42
|
+
export type DialogContentState = {
|
|
43
|
+
users: OptionData[];
|
|
44
|
+
comment: Comment_2;
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
// @public (undocumented)
|
|
48
|
+
export type DialogPlacement = Placement;
|
|
49
|
+
|
|
50
|
+
// @public (undocumented)
|
|
51
|
+
export type Flag = {
|
|
52
|
+
appearance: 'success';
|
|
53
|
+
title: MessageDescriptor;
|
|
54
|
+
type: FlagType;
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
// @public (undocumented)
|
|
58
|
+
export type FlagType = 'object-shared' | 'admin-notified';
|
|
59
|
+
|
|
60
|
+
// @public (undocumented)
|
|
61
|
+
export type FormChildrenArgs<T> = {
|
|
62
|
+
formProps: React.DetailedHTMLProps<
|
|
63
|
+
React.FormHTMLAttributes<HTMLFormElement>,
|
|
64
|
+
HTMLFormElement
|
|
65
|
+
>;
|
|
66
|
+
getValues: () => T;
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
// @public (undocumented)
|
|
70
|
+
export type KeysOfType<T, TProp> = {
|
|
71
|
+
[P in keyof T]: T[P] extends TProp ? P : never;
|
|
72
|
+
}[keyof T];
|
|
73
|
+
|
|
74
|
+
// @public (undocumented)
|
|
75
|
+
export type MessageDescriptor = {
|
|
76
|
+
id: string;
|
|
77
|
+
description: string;
|
|
78
|
+
defaultMessage: string;
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
// @public (undocumented)
|
|
82
|
+
export type MetaData = {
|
|
83
|
+
productId: string;
|
|
84
|
+
atlOriginId: string;
|
|
85
|
+
shareeAction?: 'view' | 'edit';
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
// @public (undocumented)
|
|
89
|
+
export const OBJECT_SHARED = 'object-shared';
|
|
90
|
+
|
|
91
|
+
// @public (undocumented)
|
|
92
|
+
export type OriginAnalyticAttributes = {
|
|
93
|
+
hasGeneratedId: boolean;
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
// @public (undocumented)
|
|
97
|
+
export type OriginTracing = {
|
|
98
|
+
id: string;
|
|
99
|
+
addToUrl: (link: string) => string;
|
|
100
|
+
toAnalyticsAttributes: (
|
|
101
|
+
attrs: OriginAnalyticAttributes,
|
|
102
|
+
) => OriginTracingWithIdGenerated | OriginTracingForSubSequentEvents;
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
// @public (undocumented)
|
|
106
|
+
export type OriginTracingFactory = () => OriginTracing;
|
|
107
|
+
|
|
108
|
+
// @public (undocumented)
|
|
109
|
+
export type OriginTracingForSubSequentEvents = {
|
|
110
|
+
originId: string;
|
|
111
|
+
originProduct: string;
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
// @public (undocumented)
|
|
115
|
+
export type OriginTracingWithIdGenerated = {
|
|
116
|
+
originIdGenerated: string;
|
|
117
|
+
originProduct: string;
|
|
118
|
+
};
|
|
119
|
+
|
|
120
|
+
// @public
|
|
121
|
+
export type ProductId =
|
|
122
|
+
| 'bitbucket'
|
|
123
|
+
| 'confluence'
|
|
124
|
+
| 'jira-addon'
|
|
125
|
+
| 'jira-core'
|
|
126
|
+
| 'jira-platform'
|
|
127
|
+
| 'jira-polaris'
|
|
128
|
+
| 'jira-portfolio'
|
|
129
|
+
| 'jira-servicedesk'
|
|
130
|
+
| 'jira-software'
|
|
131
|
+
| 'jira-unknown'
|
|
132
|
+
| 'trello';
|
|
133
|
+
|
|
134
|
+
// @public (undocumented)
|
|
135
|
+
export type ProductName = 'jira' | 'confluence';
|
|
136
|
+
|
|
137
|
+
// @public (undocumented)
|
|
138
|
+
export type RenderCustomTriggerButton = (
|
|
139
|
+
args: {
|
|
140
|
+
error?: ShareError;
|
|
141
|
+
isDisabled?: boolean;
|
|
142
|
+
isSelected?: boolean;
|
|
143
|
+
onClick: () => void;
|
|
144
|
+
},
|
|
145
|
+
triggerProps: TriggerProps,
|
|
146
|
+
) => React.ReactNode;
|
|
147
|
+
|
|
148
|
+
// @public (undocumented)
|
|
149
|
+
export type ShareButtonStyle = 'icon-only' | 'icon-with-text' | 'text-only';
|
|
150
|
+
|
|
151
|
+
// @public (undocumented)
|
|
152
|
+
export type ShareContentState = {
|
|
153
|
+
users: User[];
|
|
154
|
+
comment?: Comment_2;
|
|
155
|
+
};
|
|
156
|
+
|
|
157
|
+
// @public (undocumented)
|
|
158
|
+
export const ShareDialogContainer: React_2.ForwardRefExoticComponent<
|
|
159
|
+
Pick<
|
|
160
|
+
Omit<
|
|
161
|
+
WithAnalyticsEventsProps & ShareDialogContainerProps,
|
|
162
|
+
keyof WithAnalyticsEventsProps
|
|
163
|
+
>,
|
|
164
|
+
| 'onTriggerButtonClick'
|
|
165
|
+
| 'isAutoOpenDialog'
|
|
166
|
+
| 'shouldCloseOnEscapePress'
|
|
167
|
+
| 'dialogPlacement'
|
|
168
|
+
| 'loadUserOptions'
|
|
169
|
+
| 'onDialogOpen'
|
|
170
|
+
| 'onDialogClose'
|
|
171
|
+
| 'onUserSelectionChange'
|
|
172
|
+
| 'renderCustomTriggerButton'
|
|
173
|
+
| 'shareContentType'
|
|
174
|
+
| 'shareFormTitle'
|
|
175
|
+
| 'shareFormHelperMessage'
|
|
176
|
+
| 'showFlags'
|
|
177
|
+
| 'loggedInAccountId'
|
|
178
|
+
| 'triggerButtonAppearance'
|
|
179
|
+
| 'triggerButtonIcon'
|
|
180
|
+
| 'triggerButtonStyle'
|
|
181
|
+
| 'triggerButtonTooltipPosition'
|
|
182
|
+
| 'triggerButtonTooltipText'
|
|
183
|
+
| 'cloudId'
|
|
184
|
+
| 'bottomMessage'
|
|
185
|
+
| 'customFooter'
|
|
186
|
+
| 'isCopyDisabled'
|
|
187
|
+
| 'isPublicLink'
|
|
188
|
+
| 'integrationMode'
|
|
189
|
+
| 'shareFieldsFooter'
|
|
190
|
+
| 'shareIntegrations'
|
|
191
|
+
| 'shareAri'
|
|
192
|
+
| 'tabIndex'
|
|
193
|
+
| 'copyTooltipText'
|
|
194
|
+
| 'dialogZIndex'
|
|
195
|
+
| 'orgId'
|
|
196
|
+
| 'shareClient'
|
|
197
|
+
| 'urlShortenerClient'
|
|
198
|
+
| 'shortLinkData'
|
|
199
|
+
| 'formatCopyLink'
|
|
200
|
+
| 'originTracingFactory'
|
|
201
|
+
| 'productId'
|
|
202
|
+
| 'shareLink'
|
|
203
|
+
| 'shareTitle'
|
|
204
|
+
| 'useUrlShortener'
|
|
205
|
+
> &
|
|
206
|
+
Partial<
|
|
207
|
+
Pick<
|
|
208
|
+
Omit<
|
|
209
|
+
WithAnalyticsEventsProps & ShareDialogContainerProps,
|
|
210
|
+
keyof WithAnalyticsEventsProps
|
|
211
|
+
>,
|
|
212
|
+
'enableSmartUserPicker' | 'product' | 'shareeAction'
|
|
213
|
+
>
|
|
214
|
+
> &
|
|
215
|
+
Partial<
|
|
216
|
+
Pick<
|
|
217
|
+
{
|
|
218
|
+
enableSmartUserPicker: boolean;
|
|
219
|
+
shareeAction: 'view' | 'edit';
|
|
220
|
+
product: string;
|
|
221
|
+
},
|
|
222
|
+
never
|
|
223
|
+
>
|
|
224
|
+
> &
|
|
225
|
+
React_2.RefAttributes<any>
|
|
226
|
+
>;
|
|
227
|
+
|
|
228
|
+
// @public (undocumented)
|
|
229
|
+
export type ShareDialogContainerProps = {
|
|
230
|
+
onTriggerButtonClick?: () => void;
|
|
231
|
+
onDialogOpen?: () => void;
|
|
232
|
+
onDialogClose?: () => void;
|
|
233
|
+
isAutoOpenDialog?: boolean;
|
|
234
|
+
shareClient?: ShareClient;
|
|
235
|
+
urlShortenerClient?: UrlShortenerClient;
|
|
236
|
+
shortLinkData?: ShortenRequest;
|
|
237
|
+
cloudId: string;
|
|
238
|
+
orgId?: string;
|
|
239
|
+
dialogPlacement?: DialogPlacement;
|
|
240
|
+
dialogZIndex?: number;
|
|
241
|
+
formatCopyLink?: (origin: OriginTracing, link: string) => string;
|
|
242
|
+
loadUserOptions?: LoadOptions;
|
|
243
|
+
originTracingFactory: OriginTracingFactory;
|
|
244
|
+
productId: ProductId;
|
|
245
|
+
renderCustomTriggerButton?: RenderCustomTriggerButton;
|
|
246
|
+
shareAri: string;
|
|
247
|
+
shareContentType: string;
|
|
248
|
+
shareLink?: string;
|
|
249
|
+
shareTitle: string;
|
|
250
|
+
shareFormTitle?: React.ReactNode;
|
|
251
|
+
shareFormHelperMessage?: string;
|
|
252
|
+
shouldCloseOnEscapePress?: boolean;
|
|
253
|
+
showFlags: (flags: Array<Flag>) => void;
|
|
254
|
+
enableSmartUserPicker?: boolean;
|
|
255
|
+
loggedInAccountId?: string;
|
|
256
|
+
triggerButtonAppearance?: Appearance;
|
|
257
|
+
triggerButtonIcon?: React.ComponentType<IconProps>;
|
|
258
|
+
triggerButtonStyle?: ShareButtonStyle;
|
|
259
|
+
triggerButtonTooltipPosition?: TooltipPosition;
|
|
260
|
+
triggerButtonTooltipText?: React.ReactNode;
|
|
261
|
+
bottomMessage?: React.ReactNode;
|
|
262
|
+
useUrlShortener?: boolean;
|
|
263
|
+
shareeAction?: 'view' | 'edit';
|
|
264
|
+
product?: ProductName;
|
|
265
|
+
customFooter?: React.ReactNode;
|
|
266
|
+
onUserSelectionChange?: (value: Value) => void;
|
|
267
|
+
shareFieldsFooter?: React.ReactNode;
|
|
268
|
+
isCopyDisabled?: boolean;
|
|
269
|
+
isPublicLink?: boolean;
|
|
270
|
+
integrationMode?: IntegrationMode;
|
|
271
|
+
shareIntegrations?: Array<Integration>;
|
|
272
|
+
tabIndex?: number;
|
|
273
|
+
copyTooltipText?: string;
|
|
274
|
+
};
|
|
275
|
+
|
|
276
|
+
// @public (undocumented)
|
|
277
|
+
export type ShareError = {
|
|
278
|
+
message: string;
|
|
279
|
+
};
|
|
280
|
+
|
|
281
|
+
// @public (undocumented)
|
|
282
|
+
export type ShareRequest = (
|
|
283
|
+
content: Content,
|
|
284
|
+
recipients: User[],
|
|
285
|
+
metadata: MetaData,
|
|
286
|
+
comment?: Comment_2,
|
|
287
|
+
) => Promise<ShareResponse>;
|
|
288
|
+
|
|
289
|
+
// @public (undocumented)
|
|
290
|
+
export type ShareResponse = {
|
|
291
|
+
shareRequestId: string;
|
|
292
|
+
};
|
|
293
|
+
|
|
294
|
+
// @public (undocumented)
|
|
295
|
+
export type TooltipPosition = 'top' | 'right' | 'bottom' | 'left' | 'mouse';
|
|
296
|
+
|
|
297
|
+
// @public (undocumented)
|
|
298
|
+
export type User = UserWithId | UserWithEmail;
|
|
299
|
+
|
|
300
|
+
// @public (undocumented)
|
|
301
|
+
export type UserWithEmail = {
|
|
302
|
+
type: 'user';
|
|
303
|
+
email: string;
|
|
304
|
+
};
|
|
305
|
+
|
|
306
|
+
// @public (undocumented)
|
|
307
|
+
export type UserWithId = {
|
|
308
|
+
type: 'user' | 'group' | 'team';
|
|
309
|
+
id: string;
|
|
310
|
+
};
|
|
311
|
+
|
|
312
|
+
// (No @packageDocumentation comment for this package)
|
|
313
|
+
```
|