@atlaskit/share 3.7.0 → 3.7.2

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 (140) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/cjs/clients/AtlassianUrlShortenerClient.js +0 -22
  3. package/dist/cjs/clients/ShareServiceClient.js +1 -12
  4. package/dist/cjs/clients/index.js +0 -1
  5. package/dist/cjs/components/CommentField.js +0 -9
  6. package/dist/cjs/components/CopyLinkButton.js +8 -48
  7. package/dist/cjs/components/ErrorBoundary.js +0 -26
  8. package/dist/cjs/components/IntegrationButton.js +3 -15
  9. package/dist/cjs/components/IntegrationForm.js +8 -17
  10. package/dist/cjs/components/LazyShareForm/LazyShareForm.js +38 -61
  11. package/dist/cjs/components/LazyShareForm/index.js +0 -2
  12. package/dist/cjs/components/LazyShareForm/lazy.js +4 -18
  13. package/dist/cjs/components/MessagesIntlProvider.js +1 -14
  14. package/dist/cjs/components/ShareButton.js +1 -9
  15. package/dist/cjs/components/ShareDialogContainer.js +56 -123
  16. package/dist/cjs/components/ShareDialogWithTrigger.js +85 -161
  17. package/dist/cjs/components/ShareForm.js +41 -100
  18. package/dist/cjs/components/ShareFormWrapper/ShareFormWrapper.js +5 -11
  19. package/dist/cjs/components/ShareFormWrapper/index.js +0 -2
  20. package/dist/cjs/components/ShareFormWrapper/styled.js +2 -9
  21. package/dist/cjs/components/ShareHeader.js +0 -14
  22. package/dist/cjs/components/SlackIcon.js +0 -4
  23. package/dist/cjs/components/SplitButton.js +18 -43
  24. package/dist/cjs/components/UserPickerField.js +20 -70
  25. package/dist/cjs/components/analytics/analytics.js +6 -39
  26. package/dist/cjs/components/analytics/ufoExperienceHelper.js +0 -4
  27. package/dist/cjs/components/analytics/ufoExperiences.js +0 -2
  28. package/dist/cjs/components/colorSlackIcon.js +0 -4
  29. package/dist/cjs/components/localStorageUtils.js +0 -11
  30. package/dist/cjs/components/monochromeSlackIcon.js +2 -4
  31. package/dist/cjs/components/styles.js +2 -16
  32. package/dist/cjs/components/utils.js +4 -19
  33. package/dist/cjs/i18n/cs.js +0 -1
  34. package/dist/cjs/i18n/da.js +1 -2
  35. package/dist/cjs/i18n/de.js +0 -1
  36. package/dist/cjs/i18n/en.js +29 -22
  37. package/dist/cjs/i18n/en_GB.js +29 -22
  38. package/dist/cjs/i18n/en_ZZ.js +0 -1
  39. package/dist/cjs/i18n/es.js +0 -1
  40. package/dist/cjs/i18n/et.js +0 -1
  41. package/dist/cjs/i18n/fi.js +0 -1
  42. package/dist/cjs/i18n/fr.js +0 -1
  43. package/dist/cjs/i18n/hu.js +0 -1
  44. package/dist/cjs/i18n/index.js +0 -31
  45. package/dist/cjs/i18n/is.js +0 -1
  46. package/dist/cjs/i18n/it.js +0 -1
  47. package/dist/cjs/i18n/ja.js +0 -1
  48. package/dist/cjs/i18n/ko.js +0 -1
  49. package/dist/cjs/i18n/languages.js +0 -1
  50. package/dist/cjs/i18n/nb.js +0 -1
  51. package/dist/cjs/i18n/nl.js +0 -1
  52. package/dist/cjs/i18n/pl.js +0 -1
  53. package/dist/cjs/i18n/pt_BR.js +0 -1
  54. package/dist/cjs/i18n/pt_PT.js +0 -1
  55. package/dist/cjs/i18n/ro.js +0 -1
  56. package/dist/cjs/i18n/ru.js +0 -1
  57. package/dist/cjs/i18n/sk.js +0 -1
  58. package/dist/cjs/i18n/sv.js +0 -1
  59. package/dist/cjs/i18n/th.js +0 -1
  60. package/dist/cjs/i18n/tr.js +0 -1
  61. package/dist/cjs/i18n/uk.js +0 -1
  62. package/dist/cjs/i18n/vi.js +0 -1
  63. package/dist/cjs/i18n/zh.js +0 -1
  64. package/dist/cjs/i18n/zh_TW.js +0 -1
  65. package/dist/cjs/i18n.js +2 -3
  66. package/dist/cjs/index.js +0 -3
  67. package/dist/cjs/types/ShareEntities.js +0 -1
  68. package/dist/cjs/types/index.js +0 -2
  69. package/dist/cjs/util/i18n-util.js +2 -8
  70. package/dist/cjs/version.json +1 -1
  71. package/dist/es2019/clients/AtlassianUrlShortenerClient.js +0 -6
  72. package/dist/es2019/clients/ShareServiceClient.js +1 -4
  73. package/dist/es2019/components/CopyLinkButton.js +2 -13
  74. package/dist/es2019/components/ErrorBoundary.js +0 -10
  75. package/dist/es2019/components/IntegrationButton.js +0 -2
  76. package/dist/es2019/components/LazyShareForm/LazyShareForm.js +5 -14
  77. package/dist/es2019/components/LazyShareForm/lazy.js +3 -5
  78. package/dist/es2019/components/MessagesIntlProvider.js +2 -3
  79. package/dist/es2019/components/ShareDialogContainer.js +21 -59
  80. package/dist/es2019/components/ShareDialogWithTrigger.js +29 -68
  81. package/dist/es2019/components/ShareForm.js +4 -24
  82. package/dist/es2019/components/ShareFormWrapper/ShareFormWrapper.js +0 -2
  83. package/dist/es2019/components/ShareFormWrapper/styled.js +2 -1
  84. package/dist/es2019/components/SlackIcon.js +0 -2
  85. package/dist/es2019/components/SplitButton.js +2 -5
  86. package/dist/es2019/components/UserPickerField.js +2 -23
  87. package/dist/es2019/components/analytics/analytics.js +9 -13
  88. package/dist/es2019/components/analytics/ufoExperienceHelper.js +0 -2
  89. package/dist/es2019/components/colorSlackIcon.js +0 -2
  90. package/dist/es2019/components/localStorageUtils.js +0 -3
  91. package/dist/es2019/components/monochromeSlackIcon.js +2 -2
  92. package/dist/es2019/components/styles.js +3 -2
  93. package/dist/es2019/components/utils.js +7 -8
  94. package/dist/es2019/i18n/da.js +1 -1
  95. package/dist/es2019/i18n/en.js +29 -21
  96. package/dist/es2019/i18n/en_GB.js +29 -21
  97. package/dist/es2019/i18n.js +2 -1
  98. package/dist/es2019/index.js +2 -1
  99. package/dist/es2019/types/ShareEntities.js +1 -1
  100. package/dist/es2019/util/i18n-util.js +1 -5
  101. package/dist/es2019/version.json +1 -1
  102. package/dist/esm/clients/AtlassianUrlShortenerClient.js +0 -16
  103. package/dist/esm/clients/ShareServiceClient.js +1 -7
  104. package/dist/esm/components/CopyLinkButton.js +8 -31
  105. package/dist/esm/components/ErrorBoundary.js +0 -18
  106. package/dist/esm/components/IntegrationButton.js +3 -8
  107. package/dist/esm/components/IntegrationForm.js +8 -10
  108. package/dist/esm/components/LazyShareForm/LazyShareForm.js +38 -47
  109. package/dist/esm/components/LazyShareForm/lazy.js +5 -7
  110. package/dist/esm/components/MessagesIntlProvider.js +1 -6
  111. package/dist/esm/components/ShareButton.js +1 -2
  112. package/dist/esm/components/ShareDialogContainer.js +56 -108
  113. package/dist/esm/components/ShareDialogWithTrigger.js +89 -157
  114. package/dist/esm/components/ShareForm.js +41 -74
  115. package/dist/esm/components/ShareFormWrapper/ShareFormWrapper.js +5 -7
  116. package/dist/esm/components/ShareFormWrapper/styled.js +2 -1
  117. package/dist/esm/components/ShareHeader.js +0 -2
  118. package/dist/esm/components/SlackIcon.js +0 -2
  119. package/dist/esm/components/SplitButton.js +18 -24
  120. package/dist/esm/components/UserPickerField.js +20 -54
  121. package/dist/esm/components/analytics/analytics.js +6 -15
  122. package/dist/esm/components/analytics/ufoExperienceHelper.js +0 -2
  123. package/dist/esm/components/colorSlackIcon.js +0 -2
  124. package/dist/esm/components/localStorageUtils.js +0 -3
  125. package/dist/esm/components/monochromeSlackIcon.js +2 -2
  126. package/dist/esm/components/styles.js +2 -7
  127. package/dist/esm/components/utils.js +7 -8
  128. package/dist/esm/i18n/da.js +1 -1
  129. package/dist/esm/i18n/en.js +29 -21
  130. package/dist/esm/i18n/en_GB.js +29 -21
  131. package/dist/esm/i18n.js +2 -1
  132. package/dist/esm/index.js +2 -1
  133. package/dist/esm/types/ShareEntities.js +1 -1
  134. package/dist/esm/util/i18n-util.js +1 -5
  135. package/dist/esm/version.json +1 -1
  136. package/dist/types/components/LazyShareForm/LazyShareForm.d.ts +1 -1
  137. package/dist/types/i18n/en.d.ts +27 -19
  138. package/dist/types/i18n/en_GB.d.ts +27 -19
  139. package/dist/types/types/ShareForm.d.ts +0 -1
  140. package/package.json +2 -2
@@ -7,17 +7,11 @@ import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstruct
7
7
  import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
8
8
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
9
9
  import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
10
-
11
10
  var _templateObject;
12
-
13
11
  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; }
14
-
15
12
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
16
-
17
13
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
18
-
19
14
  function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
20
-
21
15
  /** @jsx jsx */
22
16
  import React from 'react';
23
17
  import { css, jsx } from '@emotion/react';
@@ -30,8 +24,10 @@ import { layers } from '@atlaskit/theme/constants';
30
24
  import Aktooltip from '@atlaskit/tooltip';
31
25
  import { messages } from '../i18n';
32
26
  import { OBJECT_SHARED } from '../types';
33
- import { cancelShare, CHANNEL_ID, copyLinkButtonClicked, formShareSubmitted, screenEvent, shareSplitButtonEvent, shareTabClicked, shareTriggerButtonClicked // type TabSubjectIdType,
34
- } from './analytics/analytics'; // eslint-disable-next-line no-duplicate-imports
27
+ import { cancelShare, CHANNEL_ID, copyLinkButtonClicked, formShareSubmitted, screenEvent, shareSplitButtonEvent, shareTabClicked, shareTriggerButtonClicked
28
+ // type TabSubjectIdType,
29
+ } from './analytics/analytics';
30
+ // eslint-disable-next-line no-duplicate-imports
35
31
 
36
32
  import { isValidFailedExperience } from './analytics/ufoExperienceHelper';
37
33
  import { renderShareDialogExp, shareSubmitExp } from './analytics/ufoExperiences';
@@ -50,26 +46,17 @@ export var defaultShareContentState = {
50
46
  // eslint-disable-next-line @repo/internal/react/no-class-components
51
47
  export var ShareDialogWithTriggerInternal = /*#__PURE__*/function (_React$PureComponent) {
52
48
  _inherits(ShareDialogWithTriggerInternal, _React$PureComponent);
53
-
54
49
  var _super = _createSuper(ShareDialogWithTriggerInternal);
55
-
56
50
  function ShareDialogWithTriggerInternal() {
57
51
  var _this;
58
-
59
52
  _classCallCheck(this, ShareDialogWithTriggerInternal);
60
-
61
53
  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
62
54
  args[_key] = arguments[_key];
63
55
  }
64
-
65
56
  _this = _super.call.apply(_super, [this].concat(args));
66
-
67
57
  _defineProperty(_assertThisInitialized(_this), "containerRef", /*#__PURE__*/React.createRef());
68
-
69
58
  _defineProperty(_assertThisInitialized(_this), "selectPortalRef", /*#__PURE__*/React.createRef());
70
-
71
59
  _defineProperty(_assertThisInitialized(_this), "start", 0);
72
-
73
60
  _defineProperty(_assertThisInitialized(_this), "state", {
74
61
  isDialogOpen: false,
75
62
  isSharing: false,
@@ -81,7 +68,6 @@ export var ShareDialogWithTriggerInternal = /*#__PURE__*/function (_React$PureCo
81
68
  tabIndex: 0,
82
69
  isLoading: false
83
70
  });
84
-
85
71
  _defineProperty(_assertThisInitialized(_this), "closeAndResetDialog", function () {
86
72
  _this.setState({
87
73
  defaultValue: defaultShareContentState,
@@ -91,58 +77,48 @@ export var ShareDialogWithTriggerInternal = /*#__PURE__*/function (_React$PureCo
91
77
  showIntegrationForm: false,
92
78
  selectedIntegration: null
93
79
  });
94
-
95
80
  var _this$props = _this.props,
96
- onUserSelectionChange = _this$props.onUserSelectionChange,
97
- onDialogClose = _this$props.onDialogClose;
98
-
81
+ onUserSelectionChange = _this$props.onUserSelectionChange,
82
+ onDialogClose = _this$props.onDialogClose;
99
83
  if (onUserSelectionChange) {
100
84
  onUserSelectionChange(defaultShareContentState.users);
101
85
  }
102
-
103
86
  if (onDialogClose) {
104
87
  onDialogClose();
105
88
  }
106
89
  });
107
-
108
90
  _defineProperty(_assertThisInitialized(_this), "createAndFireEvent", function (payload) {
109
91
  var _this$props2 = _this.props,
110
- createAnalyticsEvent = _this$props2.createAnalyticsEvent,
111
- analyticsDecorator = _this$props2.analyticsDecorator;
112
-
92
+ createAnalyticsEvent = _this$props2.createAnalyticsEvent,
93
+ analyticsDecorator = _this$props2.analyticsDecorator;
113
94
  if (analyticsDecorator) {
114
95
  payload = analyticsDecorator(payload);
115
96
  }
116
-
117
97
  if (createAnalyticsEvent) {
118
98
  createAnalyticsEvent(payload).fire(CHANNEL_ID);
119
99
  }
120
100
  });
121
-
122
101
  _defineProperty(_assertThisInitialized(_this), "onTabChange", function (index) {
123
102
  var subjectId = 'shareTab';
124
103
  var _this$props3 = _this.props,
125
- shareContentType = _this$props3.shareContentType,
126
- isJwmShareToSlackFFEnabled = _this$props3.isJwmShareToSlackFFEnabled;
127
-
104
+ shareContentType = _this$props3.shareContentType,
105
+ isJwmShareToSlackFFEnabled = _this$props3.isJwmShareToSlackFFEnabled;
128
106
  if (index === 1) {
129
107
  subjectId = 'shareToSlackTab';
130
108
  }
131
-
132
109
  _this.createAndFireEvent(shareTabClicked(subjectId, shareContentType, isJwmShareToSlackFFEnabled));
133
-
134
110
  _this.setState({
135
111
  tabIndex: index
136
112
  });
137
113
  });
138
-
139
114
  _defineProperty(_assertThisInitialized(_this), "getFlags", function () {
140
- var formatMessage = _this.props.intl.formatMessage; // The reason for providing message property is that in jira,
115
+ var formatMessage = _this.props.intl.formatMessage;
116
+
117
+ // The reason for providing message property is that in jira,
141
118
  // the Flag system takes only Message Descriptor as payload
142
119
  // and formatMessage is called for every flag
143
120
  // if the translation data is not provided, a translated default message
144
121
  // will be displayed
145
-
146
122
  return [{
147
123
  appearance: 'success',
148
124
  title: _objectSpread(_objectSpread({}, messages.shareSuccessMessage), {}, {
@@ -153,31 +129,25 @@ export var ShareDialogWithTriggerInternal = /*#__PURE__*/function (_React$PureCo
153
129
  type: OBJECT_SHARED
154
130
  }];
155
131
  });
156
-
157
132
  _defineProperty(_assertThisInitialized(_this), "setIsLoading", function (isLoading) {
158
133
  _this.setState({
159
134
  isLoading: isLoading
160
135
  });
161
136
  });
162
-
163
137
  _defineProperty(_assertThisInitialized(_this), "focus", function () {
164
138
  if (_this.containerRef.current) {
165
139
  _this.containerRef.current.focus();
166
140
  }
167
141
  });
168
-
169
142
  _defineProperty(_assertThisInitialized(_this), "handleKeyDown", function (event) {
170
143
  var _this$state = _this.state,
171
- isLoading = _this$state.isLoading,
172
- isDialogOpen = _this$state.isDialogOpen;
144
+ isLoading = _this$state.isLoading,
145
+ isDialogOpen = _this$state.isDialogOpen;
173
146
  var shouldCloseOnEscapePress = _this.props.shouldCloseOnEscapePress;
174
-
175
147
  if (isLoading) {
176
148
  event.stopPropagation();
177
-
178
149
  _this.focus();
179
150
  }
180
-
181
151
  if (isDialogOpen) {
182
152
  switch (event.key) {
183
153
  case 'Esc':
@@ -186,31 +156,25 @@ export var ShareDialogWithTriggerInternal = /*#__PURE__*/function (_React$PureCo
186
156
  // need to prevent that if the dialog is set to not close on `ESC`
187
157
  if (!shouldCloseOnEscapePress) {
188
158
  event.preventDefault();
189
- event.stopPropagation(); // put the focus back onto the share dialog so that
159
+ event.stopPropagation();
160
+ // put the focus back onto the share dialog so that
190
161
  // the user can press the escape key again to close the dialog
191
-
192
162
  _this.focus();
193
-
194
163
  return;
195
- } // The dialog will auto-close in @atlaskit/popup, we just need to fire
164
+ }
165
+ // The dialog will auto-close in @atlaskit/popup, we just need to fire
196
166
  // the right events.
197
-
198
-
199
167
  if (shouldCloseOnEscapePress) {
200
168
  // This experience should be aborted in a scenario when a user closes the dialog before the shareClient.getConfig() call is finished
201
169
  // It is a race condition between the `SUCCEEDED` case and the `ABORTED` case of this experience
202
170
  // UFO experiences can only have one FINAL state so it doesn't matter if we call .abort() after the experience has succeeded and vice versa
203
171
  renderShareDialogExp.abort();
204
-
205
172
  _this.createAndFireEvent(cancelShare(_this.start));
206
-
207
173
  _this.closeAndResetDialog();
208
174
  }
209
-
210
175
  }
211
176
  }
212
177
  });
213
-
214
178
  _defineProperty(_assertThisInitialized(_this), "handleDialogOpen", function () {
215
179
  _this.setState(function (state) {
216
180
  return {
@@ -221,48 +185,38 @@ export var ShareDialogWithTriggerInternal = /*#__PURE__*/function (_React$PureCo
221
185
  };
222
186
  }, function () {
223
187
  var _this$props4 = _this.props,
224
- onDialogOpen = _this$props4.onDialogOpen,
225
- isPublicLink = _this$props4.isPublicLink;
188
+ onDialogOpen = _this$props4.onDialogOpen,
189
+ isPublicLink = _this$props4.isPublicLink;
226
190
  var isDialogOpen = _this.state.isDialogOpen;
227
-
228
191
  if (isDialogOpen) {
229
192
  _this.start = Date.now();
230
-
231
193
  _this.createAndFireEvent(screenEvent({
232
194
  isPublicLink: isPublicLink
233
195
  }));
234
-
235
196
  if (onDialogOpen) {
236
197
  onDialogOpen();
237
198
  }
238
-
239
199
  _this.focus();
240
200
  }
241
201
  });
242
202
  });
243
-
244
203
  _defineProperty(_assertThisInitialized(_this), "onTriggerClick", function () {
245
204
  var onTriggerButtonClick = _this.props.onTriggerButtonClick;
246
-
247
205
  _this.createAndFireEvent(shareTriggerButtonClicked());
248
-
249
206
  _this.handleDialogOpen();
250
-
251
207
  if (onTriggerButtonClick) {
252
208
  onTriggerButtonClick();
253
209
  }
254
210
  });
255
-
256
211
  _defineProperty(_assertThisInitialized(_this), "handleCloseDialog", function () {
257
212
  if (_this.props.onDialogClose) {
258
213
  _this.props.onDialogClose();
259
- } // This experience should be aborted in a scenario when a user closes the dialog before the shareClient.getConfig() call is finished
214
+ }
215
+
216
+ // This experience should be aborted in a scenario when a user closes the dialog before the shareClient.getConfig() call is finished
260
217
  // It is a race condition between the `SUCCEEDED` case and the `ABORTED` case of this experience
261
218
  // UFO experiences can only have one FINAL state so it doesn't matter if we call .abort() after the experience has succeeded and vice versa
262
-
263
-
264
219
  renderShareDialogExp.abort();
265
-
266
220
  _this.setState({
267
221
  isDialogOpen: false,
268
222
  showIntegrationForm: false,
@@ -270,34 +224,26 @@ export var ShareDialogWithTriggerInternal = /*#__PURE__*/function (_React$PureCo
270
224
  tabIndex: 0
271
225
  });
272
226
  });
273
-
274
227
  _defineProperty(_assertThisInitialized(_this), "handleShareSubmit", function (data) {
275
228
  var _this$props5 = _this.props,
276
- onShareSubmit = _this$props5.onShareSubmit,
277
- shareContentType = _this$props5.shareContentType,
278
- formShareOrigin = _this$props5.formShareOrigin,
279
- showFlags = _this$props5.showFlags,
280
- isPublicLink = _this$props5.isPublicLink;
281
-
229
+ onShareSubmit = _this$props5.onShareSubmit,
230
+ shareContentType = _this$props5.shareContentType,
231
+ formShareOrigin = _this$props5.formShareOrigin,
232
+ showFlags = _this$props5.showFlags,
233
+ isPublicLink = _this$props5.isPublicLink;
282
234
  if (!onShareSubmit) {
283
235
  return;
284
236
  }
285
-
286
237
  shareSubmitExp.start();
287
-
288
238
  _this.setState({
289
239
  isSharing: true
290
240
  });
291
-
292
241
  _this.createAndFireEvent(formShareSubmitted(_this.start, data, shareContentType, formShareOrigin, isPublicLink));
293
-
294
242
  onShareSubmit(data).then(function () {
295
243
  _this.closeAndResetDialog();
296
-
297
244
  _this.setState({
298
245
  isSharing: false
299
246
  });
300
-
301
247
  showFlags(_this.getFlags());
302
248
  shareSubmitExp.success();
303
249
  }).catch(function (err) {
@@ -307,11 +253,9 @@ export var ShareDialogWithTriggerInternal = /*#__PURE__*/function (_React$PureCo
307
253
  message: err.message
308
254
  }
309
255
  });
310
-
311
256
  isValidFailedExperience(shareSubmitExp, err);
312
257
  });
313
258
  });
314
-
315
259
  _defineProperty(_assertThisInitialized(_this), "handleFormDismiss", function (data) {
316
260
  _this.setState(function (_ref) {
317
261
  var ignoreIntermediateState = _ref.ignoreIntermediateState;
@@ -320,17 +264,14 @@ export var ShareDialogWithTriggerInternal = /*#__PURE__*/function (_React$PureCo
320
264
  };
321
265
  });
322
266
  });
323
-
324
267
  _defineProperty(_assertThisInitialized(_this), "handleCopyLink", function () {
325
268
  var _this$props6 = _this.props,
326
- copyLinkOrigin = _this$props6.copyLinkOrigin,
327
- shareContentType = _this$props6.shareContentType,
328
- isPublicLink = _this$props6.isPublicLink,
329
- shareAri = _this$props6.shareAri;
330
-
269
+ copyLinkOrigin = _this$props6.copyLinkOrigin,
270
+ shareContentType = _this$props6.shareContentType,
271
+ isPublicLink = _this$props6.isPublicLink,
272
+ shareAri = _this$props6.shareAri;
331
273
  _this.createAndFireEvent(copyLinkButtonClicked(_this.start, shareContentType, copyLinkOrigin, isPublicLink, shareAri));
332
274
  });
333
-
334
275
  _defineProperty(_assertThisInitialized(_this), "handleIntegrationClick", function (integration) {
335
276
  _this.setState({
336
277
  isUsingSplitButton: false,
@@ -339,27 +280,27 @@ export var ShareDialogWithTriggerInternal = /*#__PURE__*/function (_React$PureCo
339
280
  selectedIntegration: integration
340
281
  });
341
282
  });
342
-
343
283
  _defineProperty(_assertThisInitialized(_this), "renderShareTriggerButton", function (triggerProps) {
344
284
  var _this$state2 = _this.state,
345
- isDialogOpen = _this$state2.isDialogOpen,
346
- isUsingSplitButton = _this$state2.isUsingSplitButton;
285
+ isDialogOpen = _this$state2.isDialogOpen,
286
+ isUsingSplitButton = _this$state2.isUsingSplitButton;
347
287
  var _this$props7 = _this.props,
348
- formatMessage = _this$props7.intl.formatMessage,
349
- isDisabled = _this$props7.isDisabled,
350
- renderCustomTriggerButton = _this$props7.renderCustomTriggerButton,
351
- triggerButtonIcon = _this$props7.triggerButtonIcon,
352
- triggerButtonTooltipText = _this$props7.triggerButtonTooltipText,
353
- triggerButtonTooltipPosition = _this$props7.triggerButtonTooltipPosition,
354
- triggerButtonAppearance = _this$props7.triggerButtonAppearance,
355
- triggerButtonStyle = _this$props7.triggerButtonStyle,
356
- integrationMode = _this$props7.integrationMode,
357
- shareIntegrations = _this$props7.shareIntegrations,
358
- dialogZIndex = _this$props7.dialogZIndex,
359
- dialogPlacement = _this$props7.dialogPlacement;
288
+ formatMessage = _this$props7.intl.formatMessage,
289
+ isDisabled = _this$props7.isDisabled,
290
+ renderCustomTriggerButton = _this$props7.renderCustomTriggerButton,
291
+ triggerButtonIcon = _this$props7.triggerButtonIcon,
292
+ triggerButtonTooltipText = _this$props7.triggerButtonTooltipText,
293
+ triggerButtonTooltipPosition = _this$props7.triggerButtonTooltipPosition,
294
+ triggerButtonAppearance = _this$props7.triggerButtonAppearance,
295
+ triggerButtonStyle = _this$props7.triggerButtonStyle,
296
+ integrationMode = _this$props7.integrationMode,
297
+ shareIntegrations = _this$props7.shareIntegrations,
298
+ dialogZIndex = _this$props7.dialogZIndex,
299
+ dialogPlacement = _this$props7.dialogPlacement;
360
300
  var button;
361
- var ShareButtonIcon = triggerButtonIcon || ShareIcon; // Render a custom or standard button.
301
+ var ShareButtonIcon = triggerButtonIcon || ShareIcon;
362
302
 
303
+ // Render a custom or standard button.
363
304
  if (renderCustomTriggerButton) {
364
305
  var shareError = _this.state.shareError;
365
306
  button = renderCustomTriggerButton({
@@ -380,18 +321,18 @@ export var ShareDialogWithTriggerInternal = /*#__PURE__*/function (_React$PureCo
380
321
  isSelected: isDialogOpen,
381
322
  isDisabled: isDisabled
382
323
  }, triggerProps));
383
- } // If the button only shows the icon, wrap it in a tooltip containing the button text.
384
-
324
+ }
385
325
 
326
+ // If the button only shows the icon, wrap it in a tooltip containing the button text.
386
327
  if (triggerButtonStyle === 'icon-only') {
387
328
  button = jsx(Aktooltip, {
388
329
  content: !isUsingSplitButton ? triggerButtonTooltipText || formatMessage(messages.shareTriggerButtonTooltipText) : null,
389
330
  position: triggerButtonTooltipPosition,
390
331
  hideTooltipOnClick: true
391
332
  }, button);
392
- } // If there are any integrations, wrap the share button in a split button with integrations.
393
-
333
+ }
394
334
 
335
+ // If there are any integrations, wrap the share button in a split button with integrations.
395
336
  if (integrationMode === 'split' && shareIntegrations !== null && shareIntegrations !== void 0 && shareIntegrations.length) {
396
337
  button = jsx(SplitButton, {
397
338
  shareButton: button,
@@ -406,29 +347,23 @@ export var ShareDialogWithTriggerInternal = /*#__PURE__*/function (_React$PureCo
406
347
  createAndFireEvent: _this.createAndFireEvent
407
348
  });
408
349
  }
409
-
410
350
  return button;
411
351
  });
412
-
413
352
  _defineProperty(_assertThisInitialized(_this), "handleOpenSplitButton", function () {
414
353
  _this.setState({
415
354
  isUsingSplitButton: true
416
355
  }, function () {
417
356
  return _this.handleCloseDialog();
418
357
  });
419
-
420
358
  _this.createAndFireEvent(shareSplitButtonEvent());
421
359
  });
422
-
423
360
  _defineProperty(_assertThisInitialized(_this), "handleCloseSplitButton", function () {
424
361
  _this.setState({
425
362
  isUsingSplitButton: false
426
363
  });
427
364
  });
428
-
429
365
  return _this;
430
366
  }
431
-
432
367
  _createClass(ShareDialogWithTriggerInternal, [{
433
368
  key: "componentDidMount",
434
369
  value: function componentDidMount() {
@@ -447,45 +382,44 @@ export var ShareDialogWithTriggerInternal = /*#__PURE__*/function (_React$PureCo
447
382
  key: "render",
448
383
  value: function render() {
449
384
  var _this2 = this;
450
-
451
385
  var _this$state3 = this.state,
452
- isDialogOpen = _this$state3.isDialogOpen,
453
- isSharing = _this$state3.isSharing,
454
- shareError = _this$state3.shareError,
455
- defaultValue = _this$state3.defaultValue,
456
- showIntegrationForm = _this$state3.showIntegrationForm,
457
- selectedIntegration = _this$state3.selectedIntegration;
386
+ isDialogOpen = _this$state3.isDialogOpen,
387
+ isSharing = _this$state3.isSharing,
388
+ shareError = _this$state3.shareError,
389
+ defaultValue = _this$state3.defaultValue,
390
+ showIntegrationForm = _this$state3.showIntegrationForm,
391
+ selectedIntegration = _this$state3.selectedIntegration;
458
392
  var _this$props8 = this.props,
459
- copyLink = _this$props8.copyLink,
460
- dialogPlacement = _this$props8.dialogPlacement,
461
- config = _this$props8.config,
462
- isFetchingConfig = _this$props8.isFetchingConfig,
463
- loadUserOptions = _this$props8.loadUserOptions,
464
- shareFormTitle = _this$props8.shareFormTitle,
465
- shareFormHelperMessage = _this$props8.shareFormHelperMessage,
466
- bottomMessage = _this$props8.bottomMessage,
467
- submitButtonLabel = _this$props8.submitButtonLabel,
468
- product = _this$props8.product,
469
- customFooter = _this$props8.customFooter,
470
- enableSmartUserPicker = _this$props8.enableSmartUserPicker,
471
- loggedInAccountId = _this$props8.loggedInAccountId,
472
- cloudId = _this$props8.cloudId,
473
- orgId = _this$props8.orgId,
474
- shareFieldsFooter = _this$props8.shareFieldsFooter,
475
- onUserSelectionChange = _this$props8.onUserSelectionChange,
476
- dialogZIndex = _this$props8.dialogZIndex,
477
- isPublicLink = _this$props8.isPublicLink,
478
- tabIndex = _this$props8.tabIndex,
479
- copyTooltipText = _this$props8.copyTooltipText,
480
- integrationMode = _this$props8.integrationMode,
481
- shareIntegrations = _this$props8.shareIntegrations,
482
- isBrowseUsersDisabled = _this$props8.isBrowseUsersDisabled,
483
- shareContentType = _this$props8.shareContentType;
393
+ copyLink = _this$props8.copyLink,
394
+ dialogPlacement = _this$props8.dialogPlacement,
395
+ config = _this$props8.config,
396
+ isFetchingConfig = _this$props8.isFetchingConfig,
397
+ loadUserOptions = _this$props8.loadUserOptions,
398
+ shareFormTitle = _this$props8.shareFormTitle,
399
+ shareFormHelperMessage = _this$props8.shareFormHelperMessage,
400
+ bottomMessage = _this$props8.bottomMessage,
401
+ submitButtonLabel = _this$props8.submitButtonLabel,
402
+ product = _this$props8.product,
403
+ customFooter = _this$props8.customFooter,
404
+ enableSmartUserPicker = _this$props8.enableSmartUserPicker,
405
+ loggedInAccountId = _this$props8.loggedInAccountId,
406
+ cloudId = _this$props8.cloudId,
407
+ orgId = _this$props8.orgId,
408
+ shareFieldsFooter = _this$props8.shareFieldsFooter,
409
+ onUserSelectionChange = _this$props8.onUserSelectionChange,
410
+ dialogZIndex = _this$props8.dialogZIndex,
411
+ isPublicLink = _this$props8.isPublicLink,
412
+ tabIndex = _this$props8.tabIndex,
413
+ copyTooltipText = _this$props8.copyTooltipText,
414
+ integrationMode = _this$props8.integrationMode,
415
+ shareIntegrations = _this$props8.shareIntegrations,
416
+ isBrowseUsersDisabled = _this$props8.isBrowseUsersDisabled;
484
417
  var style = typeof tabIndex !== 'undefined' && tabIndex >= 0 ? {
485
418
  outline: 'none'
486
419
  } : undefined;
487
- var footer = resolveShareFooter(integrationMode, this.state.tabIndex, customFooter); // for performance purposes, we may want to have a loadable content i.e. ShareForm
420
+ var footer = resolveShareFooter(integrationMode, this.state.tabIndex, customFooter);
488
421
 
422
+ // for performance purposes, we may want to have a loadable content i.e. ShareForm
489
423
  return jsx("div", {
490
424
  css: shareButtonWrapperStyles,
491
425
  tabIndex: tabIndex,
@@ -508,7 +442,6 @@ export var ShareDialogWithTriggerInternal = /*#__PURE__*/function (_React$PureCo
508
442
  showTitle: integrationMode !== 'tabs' || !shareIntegrations || !shareIntegrations.length,
509
443
  shareFormHelperMessage: shareFormHelperMessage,
510
444
  shareError: shareError,
511
- shareContentType: shareContentType,
512
445
  defaultValue: defaultValue,
513
446
  config: config,
514
447
  isFetchingConfig: isFetchingConfig,
@@ -524,13 +457,15 @@ export var ShareDialogWithTriggerInternal = /*#__PURE__*/function (_React$PureCo
524
457
  isPublicLink: isPublicLink,
525
458
  copyTooltipText: copyTooltipText,
526
459
  integrationMode: integrationMode,
527
- shareIntegrations: shareIntegrations // actions
460
+ shareIntegrations: shareIntegrations
461
+ // actions
528
462
  ,
529
463
  onLinkCopy: _this2.handleCopyLink,
530
464
  onSubmit: _this2.handleShareSubmit,
531
465
  onDismiss: _this2.handleFormDismiss,
532
466
  onDialogClose: _this2.handleCloseDialog,
533
- onTabChange: _this2.onTabChange //ref
467
+ onTabChange: _this2.onTabChange
468
+ //ref
534
469
  ,
535
470
  selectPortalRef: _this2.selectPortalRef,
536
471
  isBrowseUsersDisabled: isBrowseUsersDisabled
@@ -548,10 +483,8 @@ export var ShareDialogWithTriggerInternal = /*#__PURE__*/function (_React$PureCo
548
483
  })));
549
484
  }
550
485
  }]);
551
-
552
486
  return ShareDialogWithTriggerInternal;
553
487
  }(React.PureComponent);
554
-
555
488
  _defineProperty(ShareDialogWithTriggerInternal, "defaultProps", {
556
489
  isDisabled: false,
557
490
  dialogPlacement: 'bottom-end',
@@ -561,5 +494,4 @@ _defineProperty(ShareDialogWithTriggerInternal, "defaultProps", {
561
494
  triggerButtonTooltipPosition: 'top',
562
495
  dialogZIndex: layers.modal()
563
496
  });
564
-
565
497
  export var ShareDialogWithTrigger = withAnalyticsEvents()(injectIntl(ShareDialogWithTriggerInternal));