@atlaskit/share 4.4.5 → 4.5.0

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 (94) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/dist/cjs/components/ShareDialogContainer.js +2 -0
  3. package/dist/cjs/components/ShareDialogWithTrigger.js +3 -2
  4. package/dist/cjs/components/analytics/analytics.js +3 -1
  5. package/dist/es2019/components/ShareDialogContainer.js +2 -0
  6. package/dist/es2019/components/ShareDialogWithTrigger.js +3 -2
  7. package/dist/es2019/components/analytics/analytics.js +3 -2
  8. package/dist/esm/components/ShareDialogContainer.js +2 -0
  9. package/dist/esm/components/ShareDialogWithTrigger.js +3 -2
  10. package/dist/esm/components/analytics/analytics.js +3 -1
  11. package/dist/types/components/ShareDialogContainer.d.ts +1 -1
  12. package/dist/types/components/analytics/analytics.d.ts +1 -1
  13. package/dist/types/types/ShareDialogContainer.d.ts +3 -0
  14. package/dist/types/types/ShareDialogWithTrigger.d.ts +1 -1
  15. package/dist/types-ts4.5/clients/AtlassianUrlShortenerClient.d.ts +16 -0
  16. package/dist/types-ts4.5/clients/ShareServiceClient.d.ts +25 -0
  17. package/dist/types-ts4.5/clients/index.d.ts +2 -0
  18. package/dist/types-ts4.5/components/CommentField.d.ts +6 -0
  19. package/dist/types-ts4.5/components/CopyLinkButton.d.ts +37 -0
  20. package/dist/types-ts4.5/components/ErrorBoundary.d.ts +4 -0
  21. package/dist/types-ts4.5/components/IntegrationButton.d.ts +10 -0
  22. package/dist/types-ts4.5/components/IntegrationForm.d.ts +11 -0
  23. package/dist/types-ts4.5/components/LazyShareForm/LazyShareForm.d.ts +20 -0
  24. package/dist/types-ts4.5/components/LazyShareForm/index.d.ts +1 -0
  25. package/dist/types-ts4.5/components/LazyShareForm/lazy.d.ts +4 -0
  26. package/dist/types-ts4.5/components/MessagesIntlProvider.d.ts +9 -0
  27. package/dist/types-ts4.5/components/ShareButton.d.ts +14 -0
  28. package/dist/types-ts4.5/components/ShareDialogContainer.d.ts +57 -0
  29. package/dist/types-ts4.5/components/ShareDialogWithTrigger.d.ts +46 -0
  30. package/dist/types-ts4.5/components/ShareForm.d.ts +11 -0
  31. package/dist/types-ts4.5/components/ShareFormWrapper/ShareFormWrapper.d.ts +9 -0
  32. package/dist/types-ts4.5/components/ShareFormWrapper/index.d.ts +1 -0
  33. package/dist/types-ts4.5/components/ShareFormWrapper/styled.d.ts +10 -0
  34. package/dist/types-ts4.5/components/ShareHeader.d.ts +8 -0
  35. package/dist/types-ts4.5/components/SlackIcon.d.ts +3 -0
  36. package/dist/types-ts4.5/components/SplitButton.d.ts +19 -0
  37. package/dist/types-ts4.5/components/UserPickerField.d.ts +30 -0
  38. package/dist/types-ts4.5/components/analytics/analytics.d.ts +19 -0
  39. package/dist/types-ts4.5/components/analytics/ufoExperienceHelper.d.ts +2 -0
  40. package/dist/types-ts4.5/components/analytics/ufoExperiences.d.ts +3 -0
  41. package/dist/types-ts4.5/components/colorSlackIcon.d.ts +3 -0
  42. package/dist/types-ts4.5/components/monochromeSlackIcon.d.ts +3 -0
  43. package/dist/types-ts4.5/components/styles.d.ts +5 -0
  44. package/dist/types-ts4.5/components/utils.d.ts +19 -0
  45. package/dist/types-ts4.5/i18n/cs.d.ts +52 -0
  46. package/dist/types-ts4.5/i18n/da.d.ts +52 -0
  47. package/dist/types-ts4.5/i18n/de.d.ts +52 -0
  48. package/dist/types-ts4.5/i18n/en.d.ts +52 -0
  49. package/dist/types-ts4.5/i18n/en_GB.d.ts +52 -0
  50. package/dist/types-ts4.5/i18n/en_ZZ.d.ts +52 -0
  51. package/dist/types-ts4.5/i18n/es.d.ts +52 -0
  52. package/dist/types-ts4.5/i18n/et.d.ts +30 -0
  53. package/dist/types-ts4.5/i18n/fi.d.ts +52 -0
  54. package/dist/types-ts4.5/i18n/fr.d.ts +52 -0
  55. package/dist/types-ts4.5/i18n/hu.d.ts +52 -0
  56. package/dist/types-ts4.5/i18n/index.d.ts +36 -0
  57. package/dist/types-ts4.5/i18n/is.d.ts +33 -0
  58. package/dist/types-ts4.5/i18n/it.d.ts +52 -0
  59. package/dist/types-ts4.5/i18n/ja.d.ts +52 -0
  60. package/dist/types-ts4.5/i18n/ko.d.ts +52 -0
  61. package/dist/types-ts4.5/i18n/languages.d.ts +33 -0
  62. package/dist/types-ts4.5/i18n/nb.d.ts +52 -0
  63. package/dist/types-ts4.5/i18n/nl.d.ts +52 -0
  64. package/dist/types-ts4.5/i18n/pl.d.ts +52 -0
  65. package/dist/types-ts4.5/i18n/pt_BR.d.ts +52 -0
  66. package/dist/types-ts4.5/i18n/pt_PT.d.ts +30 -0
  67. package/dist/types-ts4.5/i18n/ro.d.ts +33 -0
  68. package/dist/types-ts4.5/i18n/ru.d.ts +52 -0
  69. package/dist/types-ts4.5/i18n/sk.d.ts +30 -0
  70. package/dist/types-ts4.5/i18n/sv.d.ts +52 -0
  71. package/dist/types-ts4.5/i18n/th.d.ts +52 -0
  72. package/dist/types-ts4.5/i18n/tr.d.ts +52 -0
  73. package/dist/types-ts4.5/i18n/uk.d.ts +52 -0
  74. package/dist/types-ts4.5/i18n/vi.d.ts +52 -0
  75. package/dist/types-ts4.5/i18n/zh.d.ts +52 -0
  76. package/dist/types-ts4.5/i18n/zh_TW.d.ts +52 -0
  77. package/dist/types-ts4.5/i18n.d.ts +217 -0
  78. package/dist/types-ts4.5/index.d.ts +4 -0
  79. package/dist/types-ts4.5/types/Flag.d.ts +13 -0
  80. package/dist/types-ts4.5/types/OriginTracing.d.ts +17 -0
  81. package/dist/types-ts4.5/types/Products.d.ts +3 -0
  82. package/dist/types-ts4.5/types/ShareButton.d.ts +2 -0
  83. package/dist/types-ts4.5/types/ShareContentState.d.ts +17 -0
  84. package/dist/types-ts4.5/types/ShareDialogContainer.d.ts +150 -0
  85. package/dist/types-ts4.5/types/ShareDialogWithTrigger.d.ts +45 -0
  86. package/dist/types-ts4.5/types/ShareEntities.d.ts +30 -0
  87. package/dist/types-ts4.5/types/ShareForm.d.ts +31 -0
  88. package/dist/types-ts4.5/types/User.d.ts +9 -0
  89. package/dist/types-ts4.5/types/form.d.ts +5 -0
  90. package/dist/types-ts4.5/types/index.d.ts +17 -0
  91. package/dist/types-ts4.5/util/i18n-util.d.ts +17 -0
  92. package/package.json +4 -4
  93. package/report.api.md +2 -0
  94. package/tmp/api-report-tmp.d.ts +323 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @atlaskit/share
2
2
 
3
+ ## 4.5.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#41629](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/41629) [`a1d5c2d59fb`](https://bitbucket.org/atlassian/atlassian-frontend/commits/a1d5c2d59fb) - Added optional prop to pass in the content subtype to be used for analytics.
8
+
3
9
  ## 4.4.5
4
10
 
5
11
  ### Patch Changes
@@ -325,6 +325,7 @@ var ShareDialogContainerInternal = exports.ShareDialogContainerInternal = /*#__P
325
325
  loadUserOptions = _this$props2.loadUserOptions,
326
326
  renderCustomTriggerButton = _this$props2.renderCustomTriggerButton,
327
327
  shareContentType = _this$props2.shareContentType,
328
+ shareContentSubType = _this$props2.shareContentSubType,
328
329
  shareFormTitle = _this$props2.shareFormTitle,
329
330
  shareFormHelperMessage = _this$props2.shareFormHelperMessage,
330
331
  shouldCloseOnEscapePress = _this$props2.shouldCloseOnEscapePress,
@@ -368,6 +369,7 @@ var ShareDialogContainerInternal = exports.ShareDialogContainerInternal = /*#__P
368
369
  onShareSubmit: this.handleSubmitShare,
369
370
  renderCustomTriggerButton: renderCustomTriggerButton,
370
371
  shareContentType: shareContentType,
372
+ shareContentSubType: shareContentSubType,
371
373
  shareFormTitle: shareFormTitle,
372
374
  shareFormHelperMessage: shareFormHelperMessage,
373
375
  copyLinkOrigin: this.getCopyLinkOriginTracing(),
@@ -239,7 +239,8 @@ var ShareDialogWithTriggerInternal = exports.ShareDialogWithTriggerInternal = /*
239
239
  shareContentType = _this$props4.shareContentType,
240
240
  formShareOrigin = _this$props4.formShareOrigin,
241
241
  showFlags = _this$props4.showFlags,
242
- isPublicLink = _this$props4.isPublicLink;
242
+ isPublicLink = _this$props4.isPublicLink,
243
+ shareContentSubType = _this$props4.shareContentSubType;
243
244
  if (!onShareSubmit) {
244
245
  return;
245
246
  }
@@ -247,7 +248,7 @@ var ShareDialogWithTriggerInternal = exports.ShareDialogWithTriggerInternal = /*
247
248
  _this.setState({
248
249
  isSharing: true
249
250
  });
250
- _this.createAndFireEvent((0, _analytics.formShareSubmitted)(_this.start, data, shareContentType, formShareOrigin, isPublicLink));
251
+ _this.createAndFireEvent((0, _analytics.formShareSubmitted)(_this.start, data, shareContentType, formShareOrigin, isPublicLink, shareContentSubType));
251
252
  onShareSubmit(data).then(function () {
252
253
  _this.closeAndResetDialog();
253
254
  _this.setState({
@@ -13,7 +13,7 @@ var buildAttributes = function buildAttributes() {
13
13
  var attributes = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
14
14
  return _objectSpread({
15
15
  packageName: "@atlaskit/share",
16
- packageVersion: "4.4.5"
16
+ packageVersion: "4.5.0"
17
17
  }, attributes);
18
18
  };
19
19
  var createEvent = function createEvent(eventType, source, action, actionSubject, actionSubjectId) {
@@ -103,12 +103,14 @@ var copyLinkButtonClicked = exports.copyLinkButtonClicked = function copyLinkBut
103
103
  };
104
104
  var formShareSubmitted = exports.formShareSubmitted = function formShareSubmitted(start, data, shareContentType, shareOrigin) {
105
105
  var isPublicLink = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
106
+ var shareContentSubType = arguments.length > 5 ? arguments[5] : undefined;
106
107
  var users = extractIdsByType(data, _smartUserPicker.isUser);
107
108
  var teams = extractIdsByType(data, _smartUserPicker.isTeam);
108
109
  var teamUserCounts = extractMemberCountsFromTeams(data, _smartUserPicker.isTeam);
109
110
  var emails = extractIdsByType(data, _smartUserPicker.isEmail);
110
111
  return createEvent('ui', ANALYTICS_SOURCE, 'clicked', 'button', 'submitShare', _objectSpread(_objectSpread({}, getOriginTracingAttributes(shareOrigin)), {}, {
111
112
  contentType: shareContentType,
113
+ contentSubType: shareContentSubType,
112
114
  duration: duration(start),
113
115
  emailCount: emails.length,
114
116
  teamCount: teams.length,
@@ -271,6 +271,7 @@ export class ShareDialogContainerInternal extends React.Component {
271
271
  loadUserOptions,
272
272
  renderCustomTriggerButton,
273
273
  shareContentType,
274
+ shareContentSubType,
274
275
  shareFormTitle,
275
276
  shareFormHelperMessage,
276
277
  shouldCloseOnEscapePress,
@@ -316,6 +317,7 @@ export class ShareDialogContainerInternal extends React.Component {
316
317
  onShareSubmit: this.handleSubmitShare,
317
318
  renderCustomTriggerButton: renderCustomTriggerButton,
318
319
  shareContentType: shareContentType,
320
+ shareContentSubType: shareContentSubType,
319
321
  shareFormTitle: shareFormTitle,
320
322
  shareFormHelperMessage: shareFormHelperMessage,
321
323
  copyLinkOrigin: this.getCopyLinkOriginTracing(),
@@ -232,7 +232,8 @@ export class ShareDialogWithTriggerInternal extends React.PureComponent {
232
232
  shareContentType,
233
233
  formShareOrigin,
234
234
  showFlags,
235
- isPublicLink
235
+ isPublicLink,
236
+ shareContentSubType
236
237
  } = this.props;
237
238
  if (!onShareSubmit) {
238
239
  return;
@@ -241,7 +242,7 @@ export class ShareDialogWithTriggerInternal extends React.PureComponent {
241
242
  this.setState({
242
243
  isSharing: true
243
244
  });
244
- this.createAndFireEvent(formShareSubmitted(this.start, data, shareContentType, formShareOrigin, isPublicLink));
245
+ this.createAndFireEvent(formShareSubmitted(this.start, data, shareContentType, formShareOrigin, isPublicLink, shareContentSubType));
245
246
  onShareSubmit(data).then(() => {
246
247
  this.closeAndResetDialog();
247
248
  this.setState({
@@ -1,7 +1,7 @@
1
1
  import { isEmail, isTeam, isUser } from '@atlaskit/smart-user-picker';
2
2
  const buildAttributes = (attributes = {}) => ({
3
3
  packageName: "@atlaskit/share",
4
- packageVersion: "4.4.5",
4
+ packageVersion: "4.5.0",
5
5
  ...attributes
6
6
  });
7
7
  const createEvent = (eventType, source, action, actionSubject, actionSubjectId, attributes = {}) => ({
@@ -61,7 +61,7 @@ export const copyLinkButtonClicked = (start, shareContentType, shareOrigin, isPu
61
61
  ari,
62
62
  ...getOriginTracingAttributes(shareOrigin)
63
63
  });
64
- export const formShareSubmitted = (start, data, shareContentType, shareOrigin, isPublicLink = false) => {
64
+ export const formShareSubmitted = (start, data, shareContentType, shareOrigin, isPublicLink = false, shareContentSubType) => {
65
65
  const users = extractIdsByType(data, isUser);
66
66
  const teams = extractIdsByType(data, isTeam);
67
67
  const teamUserCounts = extractMemberCountsFromTeams(data, isTeam);
@@ -69,6 +69,7 @@ export const formShareSubmitted = (start, data, shareContentType, shareOrigin, i
69
69
  return createEvent('ui', ANALYTICS_SOURCE, 'clicked', 'button', 'submitShare', {
70
70
  ...getOriginTracingAttributes(shareOrigin),
71
71
  contentType: shareContentType,
72
+ contentSubType: shareContentSubType,
72
73
  duration: duration(start),
73
74
  emailCount: emails.length,
74
75
  teamCount: teams.length,
@@ -318,6 +318,7 @@ export var ShareDialogContainerInternal = /*#__PURE__*/function (_React$Componen
318
318
  loadUserOptions = _this$props2.loadUserOptions,
319
319
  renderCustomTriggerButton = _this$props2.renderCustomTriggerButton,
320
320
  shareContentType = _this$props2.shareContentType,
321
+ shareContentSubType = _this$props2.shareContentSubType,
321
322
  shareFormTitle = _this$props2.shareFormTitle,
322
323
  shareFormHelperMessage = _this$props2.shareFormHelperMessage,
323
324
  shouldCloseOnEscapePress = _this$props2.shouldCloseOnEscapePress,
@@ -361,6 +362,7 @@ export var ShareDialogContainerInternal = /*#__PURE__*/function (_React$Componen
361
362
  onShareSubmit: this.handleSubmitShare,
362
363
  renderCustomTriggerButton: renderCustomTriggerButton,
363
364
  shareContentType: shareContentType,
365
+ shareContentSubType: shareContentSubType,
364
366
  shareFormTitle: shareFormTitle,
365
367
  shareFormHelperMessage: shareFormHelperMessage,
366
368
  copyLinkOrigin: this.getCopyLinkOriginTracing(),
@@ -235,7 +235,8 @@ export var ShareDialogWithTriggerInternal = /*#__PURE__*/function (_React$PureCo
235
235
  shareContentType = _this$props4.shareContentType,
236
236
  formShareOrigin = _this$props4.formShareOrigin,
237
237
  showFlags = _this$props4.showFlags,
238
- isPublicLink = _this$props4.isPublicLink;
238
+ isPublicLink = _this$props4.isPublicLink,
239
+ shareContentSubType = _this$props4.shareContentSubType;
239
240
  if (!onShareSubmit) {
240
241
  return;
241
242
  }
@@ -243,7 +244,7 @@ export var ShareDialogWithTriggerInternal = /*#__PURE__*/function (_React$PureCo
243
244
  _this.setState({
244
245
  isSharing: true
245
246
  });
246
- _this.createAndFireEvent(formShareSubmitted(_this.start, data, shareContentType, formShareOrigin, isPublicLink));
247
+ _this.createAndFireEvent(formShareSubmitted(_this.start, data, shareContentType, formShareOrigin, isPublicLink, shareContentSubType));
247
248
  onShareSubmit(data).then(function () {
248
249
  _this.closeAndResetDialog();
249
250
  _this.setState({
@@ -6,7 +6,7 @@ var buildAttributes = function buildAttributes() {
6
6
  var attributes = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
7
7
  return _objectSpread({
8
8
  packageName: "@atlaskit/share",
9
- packageVersion: "4.4.5"
9
+ packageVersion: "4.5.0"
10
10
  }, attributes);
11
11
  };
12
12
  var createEvent = function createEvent(eventType, source, action, actionSubject, actionSubjectId) {
@@ -96,12 +96,14 @@ export var copyLinkButtonClicked = function copyLinkButtonClicked(start, shareCo
96
96
  };
97
97
  export var formShareSubmitted = function formShareSubmitted(start, data, shareContentType, shareOrigin) {
98
98
  var isPublicLink = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
99
+ var shareContentSubType = arguments.length > 5 ? arguments[5] : undefined;
99
100
  var users = extractIdsByType(data, isUser);
100
101
  var teams = extractIdsByType(data, isTeam);
101
102
  var teamUserCounts = extractMemberCountsFromTeams(data, isTeam);
102
103
  var emails = extractIdsByType(data, isEmail);
103
104
  return createEvent('ui', ANALYTICS_SOURCE, 'clicked', 'button', 'submitShare', _objectSpread(_objectSpread({}, getOriginTracingAttributes(shareOrigin)), {}, {
104
105
  contentType: shareContentType,
106
+ contentSubType: shareContentSubType,
105
107
  duration: duration(start),
106
108
  emailCount: emails.length,
107
109
  teamCount: teams.length,
@@ -50,7 +50,7 @@ export declare class ShareDialogContainerInternal extends React.Component<WithAn
50
50
  getFormShareLink: () => string;
51
51
  render(): JSX.Element;
52
52
  }
53
- 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" | "isBrowseUsersDisabled" | "shareClient" | "urlShortenerClient" | "shortLinkData" | "formatCopyLink" | "originTracingFactory" | "productId" | "shareLink" | "shareTitle" | "useUrlShortener"> & Partial<Pick<Omit<WithAnalyticsEventsProps & ShareDialogContainerProps, keyof WithAnalyticsEventsProps>, "enableSmartUserPicker" | "product" | "shareeAction">> & Partial<Pick<{
53
+ export declare const ShareDialogContainer: React.ForwardRefExoticComponent<Pick<Omit<WithAnalyticsEventsProps & ShareDialogContainerProps, keyof WithAnalyticsEventsProps>, "onTriggerButtonClick" | "isAutoOpenDialog" | "shouldCloseOnEscapePress" | "dialogPlacement" | "loadUserOptions" | "onDialogOpen" | "onDialogClose" | "onUserSelectionChange" | "renderCustomTriggerButton" | "shareContentType" | "shareContentSubType" | "shareFormTitle" | "shareFormHelperMessage" | "showFlags" | "loggedInAccountId" | "triggerButtonAppearance" | "triggerButtonIcon" | "triggerButtonStyle" | "triggerButtonTooltipPosition" | "triggerButtonTooltipText" | "cloudId" | "bottomMessage" | "customFooter" | "isCopyDisabled" | "isPublicLink" | "integrationMode" | "shareFieldsFooter" | "shareIntegrations" | "shareAri" | "tabIndex" | "copyTooltipText" | "dialogZIndex" | "orgId" | "isBrowseUsersDisabled" | "shareClient" | "urlShortenerClient" | "shortLinkData" | "formatCopyLink" | "originTracingFactory" | "productId" | "shareLink" | "shareTitle" | "useUrlShortener"> & Partial<Pick<Omit<WithAnalyticsEventsProps & ShareDialogContainerProps, keyof WithAnalyticsEventsProps>, "enableSmartUserPicker" | "product" | "shareeAction">> & Partial<Pick<{
54
54
  enableSmartUserPicker: boolean;
55
55
  shareeAction: "view" | "edit";
56
56
  product: string;
@@ -16,4 +16,4 @@ export declare const cancelShare: (start: number) => AnalyticsEventPayload;
16
16
  export declare const shortUrlRequested: () => AnalyticsEventPayload;
17
17
  export declare const shortUrlGenerated: (start: number, tooSlow: boolean) => AnalyticsEventPayload;
18
18
  export declare const copyLinkButtonClicked: (start: number, shareContentType?: string, shareOrigin?: OriginTracing, isPublicLink?: boolean, ari?: string) => AnalyticsEventPayload;
19
- export declare const formShareSubmitted: (start: number, data: DialogContentState, shareContentType?: string, shareOrigin?: OriginTracing, isPublicLink?: boolean) => AnalyticsEventPayload;
19
+ export declare const formShareSubmitted: (start: number, data: DialogContentState, shareContentType?: string, shareOrigin?: OriginTracing, isPublicLink?: boolean, shareContentSubType?: string) => AnalyticsEventPayload;
@@ -72,6 +72,9 @@ export type ShareDialogContainerProps = {
72
72
  /** space */
73
73
  /** Any other unlisted type will have a default message of "Link shared". */
74
74
  shareContentType: string;
75
+ /** Content SubType of the resource to be shared. Optional. */
76
+ /** embed */
77
+ shareContentSubType?: string;
75
78
  /** Link of the resource to be shared (should NOT includes origin tracing).
76
79
  * Optional, the current page URL is used by default. */
77
80
  shareLink?: string;
@@ -19,7 +19,7 @@ export type DialogPlacement = Placement;
19
19
  * with the demo page and clearly visible options on that page.
20
20
  */
21
21
  export type DialogBoundariesElement = 'viewport' | 'window' | 'scrollParent';
22
- export 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' | 'isBrowseUsersDisabled'> & {
22
+ export type ShareDialogWithTriggerProps = Pick<ShareDialogContainerProps, 'onTriggerButtonClick' | 'isAutoOpenDialog' | 'shouldCloseOnEscapePress' | 'dialogPlacement' | 'loadUserOptions' | 'onDialogOpen' | 'onDialogClose' | 'onUserSelectionChange' | 'renderCustomTriggerButton' | 'shareContentType' | 'shareContentSubType' | 'shareFormTitle' | 'shareFormHelperMessage' | 'showFlags' | 'enableSmartUserPicker' | 'loggedInAccountId' | 'triggerButtonAppearance' | 'triggerButtonIcon' | 'triggerButtonStyle' | 'triggerButtonTooltipPosition' | 'triggerButtonTooltipText' | 'cloudId' | 'bottomMessage' | 'product' | 'customFooter' | 'isCopyDisabled' | 'isPublicLink' | 'integrationMode' | 'shareFieldsFooter' | 'shareIntegrations' | 'shareAri' | 'tabIndex' | 'copyTooltipText' | 'dialogZIndex' | 'orgId' | 'isBrowseUsersDisabled'> & {
23
23
  config?: ConfigResponse;
24
24
  isFetchingConfig?: boolean;
25
25
  children?: RenderCustomTriggerButton;
@@ -0,0 +1,16 @@
1
+ export interface ShortenRequest {
2
+ cloudId?: string;
3
+ product: string;
4
+ type: string;
5
+ params: Record<string, string>;
6
+ originId?: string;
7
+ }
8
+ export interface ShortenResponse {
9
+ shortUrl: string;
10
+ }
11
+ export interface UrlShortenerClient {
12
+ shorten(data: ShortenRequest): Promise<ShortenResponse>;
13
+ }
14
+ export declare class AtlassianUrlShortenerClient implements UrlShortenerClient {
15
+ shorten(data: ShortenRequest): Promise<ShortenResponse>;
16
+ }
@@ -0,0 +1,25 @@
1
+ import { ServiceConfig } from '@atlaskit/util-service-support';
2
+ import { Comment, Content, MetaData, User } from '../types';
3
+ export interface ShareClient {
4
+ share(content: Content, recipients: User[], metadata: MetaData, comment?: Comment): Promise<ShareResponse>;
5
+ getConfig(cloudId: string): Promise<ConfigResponse>;
6
+ }
7
+ export type ShareRequest = (content: Content, recipients: User[], metadata: MetaData, comment?: Comment) => Promise<ShareResponse>;
8
+ export type ShareResponse = {
9
+ shareRequestId: string;
10
+ };
11
+ export type ConfigResponse = {
12
+ disableSharingToEmails?: boolean;
13
+ };
14
+ export declare const DEFAULT_SHARE_PATH = "share";
15
+ export declare const SHARE_CONFIG_PATH = "share/configuration";
16
+ export declare const DEFAULT_SHARE_SERVICE_URL = "/gateway/api";
17
+ export declare class ShareServiceClient implements ShareClient {
18
+ private serviceConfig;
19
+ constructor(serviceConfig?: Partial<ServiceConfig>);
20
+ getConfig(cloudId: string): Promise<ConfigResponse>;
21
+ /**
22
+ * To send a POST request to the share endpoint in Share service
23
+ */
24
+ share(content: Content, recipients: User[], metadata: MetaData, comment?: Comment): Promise<ShareResponse>;
25
+ }
@@ -0,0 +1,2 @@
1
+ export { ShareServiceClient } from './ShareServiceClient';
2
+ export type { ShareClient } from './ShareServiceClient';
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ import { Comment } from '../types';
3
+ export type Props = {
4
+ defaultValue?: Comment;
5
+ };
6
+ export declare const CommentField: React.FunctionComponent<Props>;
@@ -0,0 +1,37 @@
1
+ /** @jsx jsx */
2
+ import React, { ReactElement } from 'react';
3
+ import { jsx } from '@emotion/react';
4
+ import { TriggerProps } from '@atlaskit/popup';
5
+ export declare const AUTO_DISMISS_MS: number;
6
+ export declare const messageContainerStyle: import("@emotion/react").SerializedStyles;
7
+ type InputProps = {
8
+ text: string;
9
+ };
10
+ export declare const HiddenInput: React.ForwardRefExoticComponent<InputProps & React.RefAttributes<HTMLInputElement>>;
11
+ export type Props = {
12
+ onLinkCopy?: (link: string) => void;
13
+ link: string;
14
+ isDisabled?: boolean;
15
+ copyTooltipText?: string;
16
+ children?: string | ReactElement;
17
+ copyLinkButtonText: string;
18
+ copiedToClipboardText: string;
19
+ iconBefore?: ReactElement;
20
+ };
21
+ export type State = {
22
+ shouldShowCopiedMessage: boolean;
23
+ };
24
+ export declare class CopyLinkButton extends React.Component<Props, State> {
25
+ private autoDismiss;
26
+ private inputRef;
27
+ state: {
28
+ shouldShowCopiedMessage: boolean;
29
+ };
30
+ componentWillUnmount(): void;
31
+ private clearAutoDismiss;
32
+ private handleClick;
33
+ private handleDismissCopiedMessage;
34
+ renderTriggerButton: (triggerProps: TriggerProps) => jsx.JSX.Element;
35
+ render(): jsx.JSX.Element;
36
+ }
37
+ export default CopyLinkButton;
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import { WithAnalyticsEventsProps } from '@atlaskit/analytics-next';
3
+ declare const _default: React.ForwardRefExoticComponent<Omit<WithAnalyticsEventsProps, keyof WithAnalyticsEventsProps> & React.RefAttributes<any>>;
4
+ export default _default;
@@ -0,0 +1,10 @@
1
+ /** @jsx jsx */
2
+ import React from 'react';
3
+ import { CustomThemeButtonProps } from '@atlaskit/button/types';
4
+ type Props = CustomThemeButtonProps & {
5
+ text: React.ReactNode;
6
+ IntegrationIcon: React.ComponentType;
7
+ textColor?: string;
8
+ };
9
+ declare const IntegrationButton: React.FC<Props>;
10
+ export default IntegrationButton;
@@ -0,0 +1,11 @@
1
+ /** @jsx jsx */
2
+ import React from 'react';
3
+ import { jsx } from '@emotion/react';
4
+ import { IntegrationContentProps } from '../types';
5
+ export declare const formWrapperStyle: import("@emotion/react").SerializedStyles;
6
+ export type IntegrationFormProps = {
7
+ Content: React.ComponentType<IntegrationContentProps> | null;
8
+ onIntegrationClose?: () => void;
9
+ changeTab?: (index: number) => void;
10
+ };
11
+ export declare const IntegrationForm: ({ Content, onIntegrationClose, changeTab, }: IntegrationFormProps) => jsx.JSX.Element;
@@ -0,0 +1,20 @@
1
+ import { jsx } from '@emotion/react';
2
+ import type { LoadOptions } from '@atlaskit/smart-user-picker';
3
+ import type { ShareData, ShareDialogWithTriggerProps, ShareDialogWithTriggerStates } from '../../types';
4
+ import { IntegrationFormProps } from '../IntegrationForm';
5
+ export 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' | 'isBrowseUsersDisabled'> & Pick<ShareDialogWithTriggerStates, 'showIntegrationForm' | 'selectedIntegration' | 'isSharing' | 'shareError' | 'defaultValue'> & Pick<IntegrationFormProps, 'Content'> & {
6
+ onLinkCopy: () => void;
7
+ onDismiss: (data: ShareData) => void;
8
+ onSubmit: (data: ShareData) => void;
9
+ onTabChange: (index: number) => void;
10
+ loadOptions?: LoadOptions;
11
+ selectPortalRef: any;
12
+ showTitle: boolean;
13
+ setIsLoading: (isLoading: boolean) => void;
14
+ };
15
+ /**
16
+ * A Share form content which is lazy-loaded.
17
+ * Make sure this component is not exported inside main entry points `src/index.ts`
18
+ */
19
+ declare function LazyShareForm(props: LazyShareFormProps): jsx.JSX.Element;
20
+ export default LazyShareForm;
@@ -0,0 +1 @@
1
+ export { default } from './LazyShareForm';
@@ -0,0 +1,4 @@
1
+ import { jsx } from '@emotion/react';
2
+ import type { LazyShareFormProps } from './LazyShareForm';
3
+ declare const _default: (props: LazyShareFormProps) => jsx.JSX.Element;
4
+ export default _default;
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ import { WrappedComponentProps } from 'react-intl-next';
3
+ export interface Props {
4
+ children: React.ReactChild;
5
+ }
6
+ declare const _default: React.FC<import("react-intl-next").WithIntlProps<Props & WrappedComponentProps<"intl">>> & {
7
+ WrappedComponent: React.ComponentType<Props & WrappedComponentProps<"intl">>;
8
+ };
9
+ export default _default;
@@ -0,0 +1,14 @@
1
+ import React from 'react';
2
+ import { Appearance } from '@atlaskit/button/types';
3
+ export type Props = {
4
+ appearance?: Appearance;
5
+ iconBefore?: React.ReactChild;
6
+ isLoading?: boolean;
7
+ isSelected?: boolean;
8
+ isDisabled?: boolean;
9
+ onClick: (e: React.MouseEvent<HTMLElement>) => void;
10
+ text?: React.ReactNode;
11
+ 'aria-haspopup'?: boolean;
12
+ };
13
+ export declare const ShareButton: React.ForwardRefExoticComponent<Props & React.RefAttributes<HTMLElement>>;
14
+ export default ShareButton;
@@ -0,0 +1,57 @@
1
+ import React from 'react';
2
+ import { AnalyticsEventPayload, WithAnalyticsEventsProps } from '@atlaskit/analytics-next';
3
+ import { ShortenRequest } from '../clients/AtlassianUrlShortenerClient';
4
+ import { ConfigResponse } from '../clients/ShareServiceClient';
5
+ import type { OriginTracing, OriginTracingFactory, ShareData, ShareDialogContainerProps } from '../types';
6
+ export declare const defaultConfig: ConfigResponse;
7
+ export type State = {
8
+ config?: ConfigResponse;
9
+ isFetchingConfig: boolean;
10
+ shareActionCount: number;
11
+ currentPageUrl: string;
12
+ shortenedCopyLink: null | string;
13
+ shortenedCopyLinkData?: ShortenRequest;
14
+ };
15
+ /**
16
+ * This component serves as a Provider to provide customizable implementations
17
+ * to ShareDialogTrigger component
18
+ */
19
+ export declare class ShareDialogContainerInternal extends React.Component<WithAnalyticsEventsProps & ShareDialogContainerProps, State> {
20
+ private shareClient;
21
+ private urlShortenerClient;
22
+ private _isMounted;
23
+ private _urlShorteningRequestCounter;
24
+ private _lastUrlShorteningWasTooSlow;
25
+ static defaultProps: {
26
+ enableSmartUserPicker: boolean;
27
+ shareeAction: "view" | "edit";
28
+ product: string;
29
+ };
30
+ constructor(props: ShareDialogContainerProps);
31
+ componentDidMount(): void;
32
+ componentWillUnmount(): void;
33
+ componentDidUpdate(prevProps: ShareDialogContainerProps): void;
34
+ private createAndFireEvent;
35
+ fetchConfig: () => void;
36
+ handleSubmitShare: ({ users, comment }: ShareData) => Promise<void>;
37
+ handleDialogOpen: () => Promise<void>;
38
+ decorateAnalytics: (payload: AnalyticsEventPayload) => AnalyticsEventPayload;
39
+ getUniqueCopyLinkOriginTracing: import("memoize-one").MemoizedFn<(link: string, originTracingFactory: OriginTracingFactory) => OriginTracing>;
40
+ getUniqueFormShareOriginTracing: import("memoize-one").MemoizedFn<(link: string, originTracingFactory: OriginTracingFactory, shareCount: number) => OriginTracing>;
41
+ getUpToDateShortenedCopyLink: (data: ShortenRequest, originId: string) => Promise<string | null>;
42
+ getRawLink(): string;
43
+ getCopyLinkOriginTracing(): OriginTracing;
44
+ getFormShareOriginTracing(): OriginTracing;
45
+ getFullCopyLink(): string;
46
+ shouldShortenCopyLink(): boolean;
47
+ getShortenedCopyLink(): string | undefined;
48
+ getCopyLink(): string;
49
+ updateShortCopyLink(): void;
50
+ getFormShareLink: () => string;
51
+ render(): JSX.Element;
52
+ }
53
+ export declare const ShareDialogContainer: React.ForwardRefExoticComponent<Pick<Omit<WithAnalyticsEventsProps & ShareDialogContainerProps, keyof WithAnalyticsEventsProps>, "onTriggerButtonClick" | "isAutoOpenDialog" | "shouldCloseOnEscapePress" | "dialogPlacement" | "loadUserOptions" | "onDialogOpen" | "onDialogClose" | "onUserSelectionChange" | "renderCustomTriggerButton" | "shareContentType" | "shareContentSubType" | "shareFormTitle" | "shareFormHelperMessage" | "showFlags" | "loggedInAccountId" | "triggerButtonAppearance" | "triggerButtonIcon" | "triggerButtonStyle" | "triggerButtonTooltipPosition" | "triggerButtonTooltipText" | "cloudId" | "bottomMessage" | "customFooter" | "isCopyDisabled" | "isPublicLink" | "integrationMode" | "shareFieldsFooter" | "shareIntegrations" | "shareAri" | "tabIndex" | "copyTooltipText" | "dialogZIndex" | "orgId" | "isBrowseUsersDisabled" | "shareClient" | "urlShortenerClient" | "shortLinkData" | "formatCopyLink" | "originTracingFactory" | "productId" | "shareLink" | "shareTitle" | "useUrlShortener"> & Partial<Pick<Omit<WithAnalyticsEventsProps & ShareDialogContainerProps, keyof WithAnalyticsEventsProps>, "enableSmartUserPicker" | "product" | "shareeAction">> & Partial<Pick<{
54
+ enableSmartUserPicker: boolean;
55
+ shareeAction: "view" | "edit";
56
+ product: string;
57
+ }, never>> & React.RefAttributes<any>>;
@@ -0,0 +1,46 @@
1
+ /** @jsx jsx */
2
+ import React from 'react';
3
+ import { jsx } from '@emotion/react';
4
+ import { WrappedComponentProps } from 'react-intl-next';
5
+ import { WithAnalyticsEventsProps } from '@atlaskit/analytics-next';
6
+ import { TriggerProps } from '@atlaskit/popup';
7
+ import { Value } from '@atlaskit/user-picker';
8
+ import { Integration, ShareData, ShareDialogWithTriggerProps, ShareDialogWithTriggerStates } from '../types';
9
+ export declare const defaultShareContentState: ShareData;
10
+ type ShareDialogWithTriggerInternalProps = ShareDialogWithTriggerProps & WrappedComponentProps & WithAnalyticsEventsProps;
11
+ export declare class ShareDialogWithTriggerInternal extends React.PureComponent<ShareDialogWithTriggerInternalProps, ShareDialogWithTriggerStates> {
12
+ static defaultProps: Partial<ShareDialogWithTriggerProps>;
13
+ private containerRef;
14
+ /**
15
+ * Because the PopUp component has a higher zIndex it causes
16
+ * the select to be rendered within it, and add scrollbars.
17
+ * We will render the select options the PopUp outside,
18
+ */
19
+ private selectPortalRef;
20
+ private start;
21
+ state: ShareDialogWithTriggerStates;
22
+ componentDidMount(): void;
23
+ componentDidUpdate(prevProps: ShareDialogWithTriggerProps): void;
24
+ private closeAndResetDialog;
25
+ private createAndFireEvent;
26
+ private onTabChange;
27
+ private getFlags;
28
+ private setIsLoading;
29
+ private focus;
30
+ private handleKeyDown;
31
+ private handleDialogOpen;
32
+ private onTriggerClick;
33
+ private handleCloseDialog;
34
+ private generateShareError;
35
+ private handleShareSubmit;
36
+ private handleFormDismiss;
37
+ handleCopyLink: () => void;
38
+ handleIntegrationClick: (integration: Integration) => void;
39
+ renderShareTriggerButton: (triggerProps: TriggerProps) => React.ReactNode;
40
+ handleOpenSplitButton: () => void;
41
+ handleCloseSplitButton: () => void;
42
+ handleOnUserSelectionChange: (value: Value) => void;
43
+ render(): jsx.JSX.Element;
44
+ }
45
+ export declare const ShareDialogWithTrigger: React.ComponentType<ShareDialogWithTriggerProps>;
46
+ export {};
@@ -0,0 +1,11 @@
1
+ /** @jsx jsx */
2
+ import React from 'react';
3
+ import { WrappedComponentProps } from 'react-intl-next';
4
+ import { FormChildrenArgs, ShareData, ShareFormProps, TabType } from '../types';
5
+ export declare const formWrapperStyles: import("@emotion/react").SerializedStyles;
6
+ export declare const formFooterStyles: import("@emotion/react").SerializedStyles;
7
+ export type State = {
8
+ selectedTab: TabType;
9
+ };
10
+ export type InternalFormProps = FormChildrenArgs<ShareData> & ShareFormProps & WrappedComponentProps;
11
+ export declare const ShareForm: React.FC<ShareFormProps>;
@@ -0,0 +1,9 @@
1
+ import { ReactNode } from 'react';
2
+ import { ShareDialogWithTriggerProps } from '../../types';
3
+ export type ShareFormWrapperProps = Pick<ShareDialogWithTriggerProps, 'shareFormTitle'> & {
4
+ shouldShowTitle?: boolean;
5
+ children?: ReactNode;
6
+ footer?: ReactNode;
7
+ };
8
+ declare const ShareFormWrapper: ({ shareFormTitle, shouldShowTitle, children, footer, }: ShareFormWrapperProps) => JSX.Element;
9
+ export default ShareFormWrapper;
@@ -0,0 +1 @@
1
+ export { default as ShareFormWrapper } from './ShareFormWrapper';
@@ -0,0 +1,10 @@
1
+ /** @jsx jsx */
2
+ import React from 'react';
3
+ export declare const InlineDialogFormWrapper: React.FC;
4
+ /**
5
+ * Apply the same styling, as previous @atlaskit/inline-dialog had,
6
+ * compared to the @atlaskit/popup we are now using.
7
+ *
8
+ * packages/design-system/inline-dialog/src/InlineDialog/styled.ts:20:3
9
+ */
10
+ export declare const InlineDialogContentWrapper: React.FC;
@@ -0,0 +1,8 @@
1
+ /** @jsx jsx */
2
+ import React from 'react';
3
+ import { Theme } from '@emotion/react';
4
+ export type Props = {
5
+ title?: React.ReactNode;
6
+ };
7
+ export declare const getFormHeaderTitleStyles: (theme: Theme) => import("@emotion/react").SerializedStyles;
8
+ export declare const ShareHeader: React.StatelessComponent<Props>;
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ declare const SlackIcon: () => JSX.Element;
3
+ export default SlackIcon;
@@ -0,0 +1,19 @@
1
+ /** @jsx jsx */
2
+ import React from 'react';
3
+ import { AnalyticsEventPayload } from '@atlaskit/analytics-next';
4
+ import { Appearance } from '@atlaskit/button/types';
5
+ import { DialogPlacement, Integration } from '../types';
6
+ type SplitButtonProps = {
7
+ shareButton: React.ReactNode;
8
+ handleOpenSplitButton: () => void;
9
+ handleCloseSplitButton: () => void;
10
+ isUsingSplitButton: boolean;
11
+ shareIntegrations: Array<Integration>;
12
+ onIntegrationClick: (integration: Integration) => void;
13
+ triggerButtonAppearance?: Appearance;
14
+ dialogZIndex?: number;
15
+ dialogPlacement?: DialogPlacement;
16
+ createAndFireEvent: (payload: AnalyticsEventPayload) => void;
17
+ };
18
+ export default function SplitButton({ shareButton, handleOpenSplitButton, handleCloseSplitButton, isUsingSplitButton, shareIntegrations, onIntegrationClick, triggerButtonAppearance, dialogZIndex, dialogPlacement, createAndFireEvent, }: SplitButtonProps): JSX.Element;
19
+ export {};