@atlaskit/share 6.6.2 → 6.7.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 (42) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/dist/cjs/components/LazyShareForm/LazyShareForm.js +4 -2
  3. package/dist/cjs/components/LazyShareForm/LazyShareFormNext.js +4 -2
  4. package/dist/cjs/components/ShareDialogContainer.js +4 -2
  5. package/dist/cjs/components/ShareDialogWithTrigger.js +4 -2
  6. package/dist/cjs/components/ShareDialogWithTriggerNext.js +4 -2
  7. package/dist/cjs/components/ShareForm.js +79 -167
  8. package/dist/cjs/components/ShareFormNext.js +70 -169
  9. package/dist/cjs/components/analytics/analytics.js +1 -1
  10. package/dist/es2019/components/LazyShareForm/LazyShareForm.js +4 -2
  11. package/dist/es2019/components/LazyShareForm/LazyShareFormNext.js +4 -2
  12. package/dist/es2019/components/ShareDialogContainer.js +4 -2
  13. package/dist/es2019/components/ShareDialogWithTrigger.js +4 -2
  14. package/dist/es2019/components/ShareDialogWithTriggerNext.js +4 -2
  15. package/dist/es2019/components/ShareForm.js +47 -121
  16. package/dist/es2019/components/ShareFormNext.js +37 -122
  17. package/dist/es2019/components/analytics/analytics.js +1 -1
  18. package/dist/esm/components/LazyShareForm/LazyShareForm.js +4 -2
  19. package/dist/esm/components/LazyShareForm/LazyShareFormNext.js +4 -2
  20. package/dist/esm/components/ShareDialogContainer.js +4 -2
  21. package/dist/esm/components/ShareDialogWithTrigger.js +4 -2
  22. package/dist/esm/components/ShareDialogWithTriggerNext.js +4 -2
  23. package/dist/esm/components/ShareForm.js +79 -167
  24. package/dist/esm/components/ShareFormNext.js +70 -169
  25. package/dist/esm/components/analytics/analytics.js +1 -1
  26. package/dist/types/components/LazyShareForm/LazyShareForm.d.ts +1 -1
  27. package/dist/types/components/LazyShareForm/LazyShareFormNext.d.ts +1 -1
  28. package/dist/types/components/ShareDialogContainer.d.ts +35 -34
  29. package/dist/types/index.d.ts +1 -1
  30. package/dist/types/types/ShareDialogContainer.d.ts +2 -0
  31. package/dist/types/types/ShareDialogWithTrigger.d.ts +1 -1
  32. package/dist/types/types/ShareForm.d.ts +2 -1
  33. package/dist/types/types/index.d.ts +1 -1
  34. package/dist/types-ts4.5/components/LazyShareForm/LazyShareForm.d.ts +1 -1
  35. package/dist/types-ts4.5/components/LazyShareForm/LazyShareFormNext.d.ts +1 -1
  36. package/dist/types-ts4.5/components/ShareDialogContainer.d.ts +35 -34
  37. package/dist/types-ts4.5/index.d.ts +1 -1
  38. package/dist/types-ts4.5/types/ShareDialogContainer.d.ts +2 -0
  39. package/dist/types-ts4.5/types/ShareDialogWithTrigger.d.ts +1 -1
  40. package/dist/types-ts4.5/types/ShareForm.d.ts +2 -1
  41. package/dist/types-ts4.5/types/index.d.ts +1 -1
  42. package/package.json +4 -7
@@ -170,7 +170,7 @@ var InternalForm = /*#__PURE__*/function (_React$PureComponent) {
170
170
  var formSendLabel = _i18n.messages.formShare;
171
171
  var sendLabel = isPublicLink ? formPublicLabel : formSendLabel;
172
172
  var buttonLabel = isRetryableError ? _i18n.messages.formRetry : sendLabel;
173
- var buttonDisabled = isDisabled || isNonRetryableError || isSubmitShareDisabled && (0, _platformFeatureFlags.fg)('plans_outgoing_mail_fix');
173
+ var buttonDisabled = isDisabled || isNonRetryableError || isSubmitShareDisabled;
174
174
  var ButtonLabelWrapper = buttonAppearance === 'warning' ? 'strong' : _react.default.Fragment;
175
175
  return /*#__PURE__*/_react.default.createElement(_compiled.Box, {
176
176
  xcss: (0, _css.cx)(styles.submitButtonWrapperStyles)
@@ -242,167 +242,66 @@ var InternalForm = /*#__PURE__*/function (_React$PureComponent) {
242
242
  builtInTabContentWidth = _this$props7.builtInTabContentWidth,
243
243
  handleCloseDialog = _this$props7.handleCloseDialog;
244
244
  var selectedMenuItem = this.state.selectedMenuItem;
245
- if ((0, _platformFeatureFlags.fg)('plans_outgoing_mail_fix')) {
246
- var hasShareIntegrations = shareIntegrations && shareIntegrations.length;
247
- var hasAdditionalTabs = additionalTabs && additionalTabs.length;
248
- if (integrationMode === 'off' || !hasShareIntegrations && !hasAdditionalTabs) {
249
- return this.renderShareForm();
250
- }
251
- if (selectedMenuItem === 'default') {
252
- return this.renderShareForm();
253
- }
254
- if (hasShareIntegrations) {
255
- var _firstIntegration = shareIntegrations[0];
256
- if (selectedMenuItem === 'Slack') {
257
- return /*#__PURE__*/_react.default.createElement(_IntegrationForm.IntegrationForm, {
258
- Content: _firstIntegration.Content,
259
- onIntegrationClose: function onIntegrationClose() {
260
- return handleCloseDialog === null || handleCloseDialog === void 0 ? void 0 : handleCloseDialog();
261
- }
262
- });
263
- }
264
- if (integrationMode === 'menu') {
265
- return /*#__PURE__*/_react.default.createElement(_compiled.Box, {
266
- xcss: (0, _css.cx)(styles.menuGroupContainerStyles),
267
- backgroundColor: "elevation.surface.overlay"
268
- }, /*#__PURE__*/_react.default.createElement(_menu.MenuGroup, null, /*#__PURE__*/_react.default.createElement(_ShareMenuItem.ShareMenuItem, {
269
- iconName: /*#__PURE__*/_react.default.createElement(_firstIntegration.Icon, null),
270
- labelId: _i18n.messages.slackMenuItemText,
271
- onClickHandler: function onClickHandler() {
272
- return _this2.changeMenuItem('Slack');
273
- }
274
- }), /*#__PURE__*/_react.default.createElement(_ShareMenuItem.ShareMenuItem, {
275
- iconName: /*#__PURE__*/_react.default.createElement(_email.default, {
276
- color: "currentColor",
277
- label: "",
278
- LEGACY_size: "medium",
279
- spacing: "spacious"
280
- }),
281
- labelId: _i18n.messages.emailMenuItemText,
282
- onClickHandler: function onClickHandler() {
283
- return _this2.changeMenuItem('default');
284
- }
285
- })));
286
- }
287
- }
288
- if (integrationMode === 'tabs') {
289
- var DEFAULT_TAB_CONTENT_WIDTH = 304;
290
- return /*#__PURE__*/_react.default.createElement(_tabs.default, {
291
- id: "ShareForm-Tabs-Integrations",
292
- onChange: this.changeTab,
293
- selected: this.state.selectedTab
294
- }, /*#__PURE__*/_react.default.createElement(_tabs.TabList, null, /*#__PURE__*/_react.default.createElement(_tabs.Tab, {
295
- key: "share-tab-default"
296
- }, this.renderMainTabTitle()), shareIntegrations === null || shareIntegrations === void 0 ? void 0 : shareIntegrations.map(function (integration) {
297
- return /*#__PURE__*/_react.default.createElement(_tabs.Tab, {
298
- key: "share-tab-".concat(integration.type)
299
- }, /*#__PURE__*/_react.default.createElement(_compiled.Box, {
300
- xcss: (0, _css.cx)(styles.integrationWrapperStyles)
301
- }, /*#__PURE__*/_react.default.createElement(_compiled.Box, {
302
- as: "span",
303
- xcss: (0, _css.cx)(styles.integrationIconWrapperStyles)
304
- }, /*#__PURE__*/_react.default.createElement(integration.Icon, null)), integrationTabText(integration.type)));
305
- }), (0, _platformFeatureFlags.fg)('smart_links_for_plans_platform') && (additionalTabs === null || additionalTabs === void 0 ? void 0 : additionalTabs.map(function (tab) {
306
- return /*#__PURE__*/_react.default.createElement(_tabs.Tab, {
307
- key: "share-tab-".concat(tab.label)
308
- }, tab.label);
309
- }))), /*#__PURE__*/_react.default.createElement(_tabs.TabPanel, {
310
- key: "share-tabPanel-default"
311
- }, /*#__PURE__*/_react.default.createElement(_compiled.Box, {
312
- xcss: (0, _css.cx)(styles.formWrapperStyles)
313
- }, /*#__PURE__*/_react.default.createElement("div", {
314
- style: {
315
- width: "".concat(builtInTabContentWidth || DEFAULT_TAB_CONTENT_WIDTH, "px")
316
- }
317
- }, this.renderShareForm()))), shareIntegrations === null || shareIntegrations === void 0 ? void 0 : shareIntegrations.map(function (integration) {
318
- return /*#__PURE__*/_react.default.createElement(_tabs.TabPanel, {
319
- key: "share-tabPanel-integration"
320
- }, /*#__PURE__*/_react.default.createElement(_analyticsNext.AnalyticsContext, {
321
- data: {
322
- source: _analytics.INTEGRATION_MODAL_SOURCE
323
- }
324
- }, /*#__PURE__*/_react.default.createElement(_compiled.Box, {
325
- xcss: (0, _css.cx)(styles.formWrapperStyles)
326
- }, /*#__PURE__*/_react.default.createElement("div", {
327
- style: {
328
- width: "".concat(builtInTabContentWidth || DEFAULT_TAB_CONTENT_WIDTH, "px")
329
- }
330
- }, /*#__PURE__*/_react.default.createElement(_IntegrationForm.IntegrationForm, {
331
- Content: integration.Content,
332
- onIntegrationClose: function onIntegrationClose() {
333
- return handleCloseDialog === null || handleCloseDialog === void 0 ? void 0 : handleCloseDialog();
334
- },
335
- changeTab: _this2.changeTab
336
- })))));
337
- }), (0, _platformFeatureFlags.fg)('smart_links_for_plans_platform') && (additionalTabs === null || additionalTabs === void 0 ? void 0 : additionalTabs.map(function (tab) {
338
- return /*#__PURE__*/_react.default.createElement(_tabs.TabPanel, {
339
- key: "share-tabPanel-".concat(tab.label)
340
- }, /*#__PURE__*/_react.default.createElement(_compiled.Box, {
341
- xcss: (0, _css.cx)(styles.formWrapperStyles)
342
- }, /*#__PURE__*/_react.default.createElement(_IntegrationForm.IntegrationForm, {
343
- Content: tab.Content,
344
- onIntegrationClose: function onIntegrationClose() {
345
- return handleCloseDialog === null || handleCloseDialog === void 0 ? void 0 : handleCloseDialog();
346
- },
347
- changeTab: _this2.changeTab
348
- })));
349
- })));
350
- }
351
- }
352
- if (integrationMode === 'off' || !shareIntegrations || !shareIntegrations.length) {
245
+ var hasShareIntegrations = shareIntegrations && shareIntegrations.length;
246
+ var hasAdditionalTabs = additionalTabs && additionalTabs.length;
247
+ if (integrationMode === 'off' || !hasShareIntegrations && !hasAdditionalTabs) {
353
248
  return this.renderShareForm();
354
249
  }
355
- var firstIntegration = shareIntegrations[0];
356
250
  if (selectedMenuItem === 'default') {
357
251
  return this.renderShareForm();
358
252
  }
359
- if (selectedMenuItem === 'Slack') {
360
- return /*#__PURE__*/_react.default.createElement(_IntegrationForm.IntegrationForm, {
361
- Content: firstIntegration.Content,
362
- onIntegrationClose: function onIntegrationClose() {
363
- return handleCloseDialog === null || handleCloseDialog === void 0 ? void 0 : handleCloseDialog();
364
- }
365
- });
366
- }
367
- if (integrationMode === 'menu') {
368
- return /*#__PURE__*/_react.default.createElement(_compiled.Box, {
369
- xcss: (0, _css.cx)(styles.menuGroupContainerStyles),
370
- backgroundColor: "elevation.surface.overlay"
371
- }, /*#__PURE__*/_react.default.createElement(_menu.MenuGroup, null, /*#__PURE__*/_react.default.createElement(_ShareMenuItem.ShareMenuItem, {
372
- iconName: /*#__PURE__*/_react.default.createElement(firstIntegration.Icon, null),
373
- labelId: _i18n.messages.slackMenuItemText,
374
- onClickHandler: function onClickHandler() {
375
- return _this2.changeMenuItem('Slack');
376
- }
377
- }), /*#__PURE__*/_react.default.createElement(_ShareMenuItem.ShareMenuItem, {
378
- iconName: /*#__PURE__*/_react.default.createElement(_email.default, {
379
- color: "currentColor",
380
- label: "",
381
- LEGACY_size: "medium",
382
- spacing: "spacious"
383
- }),
384
- labelId: _i18n.messages.emailMenuItemText,
385
- onClickHandler: function onClickHandler() {
386
- return _this2.changeMenuItem('default');
387
- }
388
- })));
253
+ if (hasShareIntegrations) {
254
+ var firstIntegration = shareIntegrations[0];
255
+ if (selectedMenuItem === 'Slack') {
256
+ return /*#__PURE__*/_react.default.createElement(_IntegrationForm.IntegrationForm, {
257
+ Content: firstIntegration.Content,
258
+ onIntegrationClose: function onIntegrationClose() {
259
+ return handleCloseDialog === null || handleCloseDialog === void 0 ? void 0 : handleCloseDialog();
260
+ }
261
+ });
262
+ }
263
+ if (integrationMode === 'menu') {
264
+ return /*#__PURE__*/_react.default.createElement(_compiled.Box, {
265
+ xcss: (0, _css.cx)(styles.menuGroupContainerStyles),
266
+ backgroundColor: "elevation.surface.overlay"
267
+ }, /*#__PURE__*/_react.default.createElement(_menu.MenuGroup, null, /*#__PURE__*/_react.default.createElement(_ShareMenuItem.ShareMenuItem, {
268
+ iconName: /*#__PURE__*/_react.default.createElement(firstIntegration.Icon, null),
269
+ labelId: _i18n.messages.slackMenuItemText,
270
+ onClickHandler: function onClickHandler() {
271
+ return _this2.changeMenuItem('Slack');
272
+ }
273
+ }), /*#__PURE__*/_react.default.createElement(_ShareMenuItem.ShareMenuItem, {
274
+ iconName: /*#__PURE__*/_react.default.createElement(_email.default, {
275
+ color: "currentColor",
276
+ label: "",
277
+ LEGACY_size: "medium",
278
+ spacing: "spacious"
279
+ }),
280
+ labelId: _i18n.messages.emailMenuItemText,
281
+ onClickHandler: function onClickHandler() {
282
+ return _this2.changeMenuItem('default');
283
+ }
284
+ })));
285
+ }
389
286
  }
390
287
  if (integrationMode === 'tabs') {
391
- var _DEFAULT_TAB_CONTENT_WIDTH = 304;
288
+ var DEFAULT_TAB_CONTENT_WIDTH = 304;
392
289
  return /*#__PURE__*/_react.default.createElement(_tabs.default, {
393
290
  id: "ShareForm-Tabs-Integrations",
394
291
  onChange: this.changeTab,
395
292
  selected: this.state.selectedTab
396
293
  }, /*#__PURE__*/_react.default.createElement(_tabs.TabList, null, /*#__PURE__*/_react.default.createElement(_tabs.Tab, {
397
294
  key: "share-tab-default"
398
- }, this.renderMainTabTitle()), /*#__PURE__*/_react.default.createElement(_tabs.Tab, {
399
- key: "share-tab-".concat(firstIntegration.type)
400
- }, /*#__PURE__*/_react.default.createElement(_compiled.Box, {
401
- xcss: (0, _css.cx)(styles.integrationWrapperStyles)
402
- }, /*#__PURE__*/_react.default.createElement(_compiled.Box, {
403
- as: "span",
404
- xcss: (0, _css.cx)(styles.integrationIconWrapperStyles)
405
- }, /*#__PURE__*/_react.default.createElement(firstIntegration.Icon, null)), integrationTabText(firstIntegration.type))), (0, _platformFeatureFlags.fg)('smart_links_for_plans_platform') && (additionalTabs === null || additionalTabs === void 0 ? void 0 : additionalTabs.map(function (tab) {
295
+ }, this.renderMainTabTitle()), shareIntegrations === null || shareIntegrations === void 0 ? void 0 : shareIntegrations.map(function (integration) {
296
+ return /*#__PURE__*/_react.default.createElement(_tabs.Tab, {
297
+ key: "share-tab-".concat(integration.type)
298
+ }, /*#__PURE__*/_react.default.createElement(_compiled.Box, {
299
+ xcss: (0, _css.cx)(styles.integrationWrapperStyles)
300
+ }, /*#__PURE__*/_react.default.createElement(_compiled.Box, {
301
+ as: "span",
302
+ xcss: (0, _css.cx)(styles.integrationIconWrapperStyles)
303
+ }, /*#__PURE__*/_react.default.createElement(integration.Icon, null)), integrationTabText(integration.type)));
304
+ }), (0, _platformFeatureFlags.fg)('smart_links_for_plans_platform') && (additionalTabs === null || additionalTabs === void 0 ? void 0 : additionalTabs.map(function (tab) {
406
305
  return /*#__PURE__*/_react.default.createElement(_tabs.Tab, {
407
306
  key: "share-tab-".concat(tab.label)
408
307
  }, tab.label);
@@ -412,27 +311,29 @@ var InternalForm = /*#__PURE__*/function (_React$PureComponent) {
412
311
  xcss: (0, _css.cx)(styles.formWrapperStyles)
413
312
  }, /*#__PURE__*/_react.default.createElement("div", {
414
313
  style: {
415
- width: "".concat(builtInTabContentWidth || _DEFAULT_TAB_CONTENT_WIDTH, "px")
416
- }
417
- }, this.renderShareForm()))), /*#__PURE__*/_react.default.createElement(_tabs.TabPanel, {
418
- key: "share-tabPanel-integration"
419
- }, /*#__PURE__*/_react.default.createElement(_analyticsNext.AnalyticsContext, {
420
- data: {
421
- source: _analytics.INTEGRATION_MODAL_SOURCE
314
+ width: "".concat(builtInTabContentWidth || DEFAULT_TAB_CONTENT_WIDTH, "px")
422
315
  }
423
- }, /*#__PURE__*/_react.default.createElement(_compiled.Box, {
424
- xcss: (0, _css.cx)(styles.formWrapperStyles)
425
- }, /*#__PURE__*/_react.default.createElement("div", {
426
- style: {
427
- width: "".concat(builtInTabContentWidth || _DEFAULT_TAB_CONTENT_WIDTH, "px")
428
- }
429
- }, /*#__PURE__*/_react.default.createElement(_IntegrationForm.IntegrationForm, {
430
- Content: firstIntegration.Content,
431
- onIntegrationClose: function onIntegrationClose() {
432
- return handleCloseDialog === null || handleCloseDialog === void 0 ? void 0 : handleCloseDialog();
433
- },
434
- changeTab: this.changeTab
435
- }))))), (0, _platformFeatureFlags.fg)('smart_links_for_plans_platform') && (additionalTabs === null || additionalTabs === void 0 ? void 0 : additionalTabs.map(function (tab) {
316
+ }, this.renderShareForm()))), shareIntegrations === null || shareIntegrations === void 0 ? void 0 : shareIntegrations.map(function (integration) {
317
+ return /*#__PURE__*/_react.default.createElement(_tabs.TabPanel, {
318
+ key: "share-tabPanel-integration"
319
+ }, /*#__PURE__*/_react.default.createElement(_analyticsNext.AnalyticsContext, {
320
+ data: {
321
+ source: _analytics.INTEGRATION_MODAL_SOURCE
322
+ }
323
+ }, /*#__PURE__*/_react.default.createElement(_compiled.Box, {
324
+ xcss: (0, _css.cx)(styles.formWrapperStyles)
325
+ }, /*#__PURE__*/_react.default.createElement("div", {
326
+ style: {
327
+ width: "".concat(builtInTabContentWidth || DEFAULT_TAB_CONTENT_WIDTH, "px")
328
+ }
329
+ }, /*#__PURE__*/_react.default.createElement(_IntegrationForm.IntegrationForm, {
330
+ Content: integration.Content,
331
+ onIntegrationClose: function onIntegrationClose() {
332
+ return handleCloseDialog === null || handleCloseDialog === void 0 ? void 0 : handleCloseDialog();
333
+ },
334
+ changeTab: _this2.changeTab
335
+ })))));
336
+ }), (0, _platformFeatureFlags.fg)('smart_links_for_plans_platform') && (additionalTabs === null || additionalTabs === void 0 ? void 0 : additionalTabs.map(function (tab) {
436
337
  return /*#__PURE__*/_react.default.createElement(_tabs.TabPanel, {
437
338
  key: "share-tabPanel-".concat(tab.label)
438
339
  }, /*#__PURE__*/_react.default.createElement(_compiled.Box, {
@@ -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: "6.6.2"
16
+ packageVersion: "6.7.0"
17
17
  }, attributes);
18
18
  };
19
19
  var createEvent = function createEvent(eventType, source, action, actionSubject, actionSubjectId) {
@@ -82,7 +82,8 @@ function LazyShareForm(props) {
82
82
  userPickerOptions,
83
83
  isSubmitShareDisabled,
84
84
  additionalUserFields,
85
- isExtendedShareDialogEnabled
85
+ isExtendedShareDialogEnabled,
86
+ CustomSubmitButton
86
87
  } = props;
87
88
  const header = customHeader ? jsx("div", {
88
89
  css: headerCustomStyles
@@ -150,7 +151,8 @@ function LazyShareForm(props) {
150
151
  userPickerOptions: userPickerOptions,
151
152
  isSubmitShareDisabled: isSubmitShareDisabled,
152
153
  additionalUserFields: additionalUserFields,
153
- isExtendedShareDialogEnabled: isExtendedShareDialogEnabled
154
+ isExtendedShareDialogEnabled: isExtendedShareDialogEnabled,
155
+ CustomSubmitButton: CustomSubmitButton
154
156
  }) : jsx(Text, {
155
157
  as: "p"
156
158
  }, jsx(FormattedMessage, messages.formNoPermissions))));
@@ -71,7 +71,8 @@ function LazyShareForm(props) {
71
71
  userPickerOptions,
72
72
  isSubmitShareDisabled,
73
73
  additionalUserFields,
74
- isExtendedShareDialogEnabled
74
+ isExtendedShareDialogEnabled,
75
+ CustomSubmitButton
75
76
  } = props;
76
77
  const header = customHeader ? /*#__PURE__*/React.createElement(Box, {
77
78
  xcss: styles.headerCustomStyles
@@ -139,7 +140,8 @@ function LazyShareForm(props) {
139
140
  userPickerOptions: userPickerOptions,
140
141
  isSubmitShareDisabled: isSubmitShareDisabled,
141
142
  additionalUserFields: additionalUserFields,
142
- isExtendedShareDialogEnabled: isExtendedShareDialogEnabled
143
+ isExtendedShareDialogEnabled: isExtendedShareDialogEnabled,
144
+ CustomSubmitButton: CustomSubmitButton
143
145
  }) : /*#__PURE__*/React.createElement(Text, {
144
146
  as: "p"
145
147
  }, /*#__PURE__*/React.createElement(FormattedMessage, messages.formNoPermissions))));
@@ -318,7 +318,8 @@ export class ShareDialogContainerInternal extends React.Component {
318
318
  userPickerOptions,
319
319
  isSubmitShareDisabled,
320
320
  additionalUserFields,
321
- isExtendedShareDialogEnabled
321
+ isExtendedShareDialogEnabled,
322
+ CustomSubmitButton
322
323
  } = this.props;
323
324
  const {
324
325
  config,
@@ -376,7 +377,8 @@ export class ShareDialogContainerInternal extends React.Component {
376
377
  builtInTabContentWidth: builtInTabContentWidth,
377
378
  isSubmitShareDisabled: isSubmitShareDisabled,
378
379
  additionalUserFields: additionalUserFields,
379
- isExtendedShareDialogEnabled: isExtendedShareDialogEnabled
380
+ isExtendedShareDialogEnabled: isExtendedShareDialogEnabled,
381
+ CustomSubmitButton: CustomSubmitButton
380
382
  })));
381
383
  }
382
384
  }
@@ -526,7 +526,8 @@ export class ShareDialogWithTriggerInternalLegacy extends React.PureComponent {
526
526
  userPickerOptions,
527
527
  isSubmitShareDisabled,
528
528
  additionalUserFields,
529
- isExtendedShareDialogEnabled
529
+ isExtendedShareDialogEnabled,
530
+ CustomSubmitButton
530
531
  } = this.props;
531
532
  const style = typeof tabIndex !== 'undefined' && tabIndex >= 0 ? {
532
533
  outline: 'none'
@@ -595,7 +596,8 @@ export class ShareDialogWithTriggerInternalLegacy extends React.PureComponent {
595
596
  isBrowseUsersDisabled: isBrowseUsersDisabled,
596
597
  userPickerOptions: userPickerOptions,
597
598
  additionalUserFields: additionalUserFields,
598
- isExtendedShareDialogEnabled: isExtendedShareDialogEnabled
599
+ isExtendedShareDialogEnabled: isExtendedShareDialogEnabled,
600
+ CustomSubmitButton: CustomSubmitButton
599
601
  })),
600
602
  isOpen: isDialogOpen,
601
603
  onClose: this.handleCloseDialog,
@@ -503,7 +503,8 @@ export class ShareDialogWithTriggerInternal extends React.PureComponent {
503
503
  userPickerOptions,
504
504
  isSubmitShareDisabled,
505
505
  additionalUserFields,
506
- isExtendedShareDialogEnabled
506
+ isExtendedShareDialogEnabled,
507
+ CustomSubmitButton
507
508
  } = this.props;
508
509
  const footer = resolveShareFooter(integrationMode, this.state.tabIndex, customFooter);
509
510
 
@@ -564,7 +565,8 @@ export class ShareDialogWithTriggerInternal extends React.PureComponent {
564
565
  isBrowseUsersDisabled: isBrowseUsersDisabled,
565
566
  userPickerOptions: userPickerOptions,
566
567
  additionalUserFields: additionalUserFields,
567
- isExtendedShareDialogEnabled: isExtendedShareDialogEnabled
568
+ isExtendedShareDialogEnabled: isExtendedShareDialogEnabled,
569
+ CustomSubmitButton: CustomSubmitButton
568
570
  })),
569
571
  isOpen: isDialogOpen,
570
572
  onClose: this.handleCloseDialog,
@@ -135,7 +135,10 @@ class InternalForm extends React.PureComponent {
135
135
  userPickerOptions,
136
136
  productAttributes,
137
137
  additionalUserFields,
138
- isExtendedShareDialogEnabled
138
+ isExtendedShareDialogEnabled,
139
+ isSharing,
140
+ isSubmitShareDisabled,
141
+ CustomSubmitButton
139
142
  } = this.props;
140
143
  return jsx(AnalyticsContext, {
141
144
  data: {
@@ -203,7 +206,13 @@ class InternalForm extends React.PureComponent {
203
206
  copyTooltipText: copyTooltipText,
204
207
  copyLinkButtonText: formatMessage(isPublicLink ? messages.copyPublicLinkButtonText : messages.copyLinkButtonText),
205
208
  copiedToClipboardText: formatMessage(messages.copiedToClipboardMessage)
206
- }), this.renderSubmitButton())));
209
+ }), isExtendedShareDialogEnabled && CustomSubmitButton ? jsx(CustomSubmitButton, {
210
+ shareError: shareError,
211
+ isSharing: isSharing,
212
+ isDisabled: isDisabled,
213
+ isSubmitShareDisabled: isSubmitShareDisabled,
214
+ isPublicLink: isPublicLink
215
+ }) : this.renderSubmitButton())));
207
216
  });
208
217
  _defineProperty(this, "renderSubmitButton", () => {
209
218
  const {
@@ -227,7 +236,7 @@ class InternalForm extends React.PureComponent {
227
236
  const formSendLabel = messages.formShare;
228
237
  const sendLabel = isPublicLink ? formPublicLabel : formSendLabel;
229
238
  const buttonLabel = isRetryableError ? messages.formRetry : sendLabel;
230
- const buttonDisabled = isDisabled || isNonRetryableError || isSubmitShareDisabled && fg('plans_outgoing_mail_fix');
239
+ const buttonDisabled = isDisabled || isNonRetryableError || isSubmitShareDisabled;
231
240
  const ButtonLabelWrapper = buttonAppearance === 'warning' ? 'strong' : React.Fragment;
232
241
  return jsx("div", {
233
242
  css: submitButtonWrapperStyles
@@ -301,123 +310,40 @@ class InternalForm extends React.PureComponent {
301
310
  const {
302
311
  selectedMenuItem
303
312
  } = this.state;
304
- if (fg('plans_outgoing_mail_fix')) {
305
- const hasShareIntegrations = shareIntegrations && shareIntegrations.length;
306
- const hasAdditionalTabs = additionalTabs && additionalTabs.length;
307
- if (integrationMode === 'off' || !hasShareIntegrations && !hasAdditionalTabs) {
308
- return this.renderShareForm();
309
- }
310
- if (selectedMenuItem === 'default') {
311
- return this.renderShareForm();
312
- }
313
- if (hasShareIntegrations) {
314
- const firstIntegration = shareIntegrations[0];
315
- if (selectedMenuItem === 'Slack') {
316
- return jsx(IntegrationForm, {
317
- Content: firstIntegration.Content,
318
- onIntegrationClose: () => handleCloseDialog === null || handleCloseDialog === void 0 ? void 0 : handleCloseDialog()
319
- });
320
- }
321
- if (integrationMode === 'menu') {
322
- return jsx(Box, {
323
- xcss: menuGroupContainerStyles
324
- }, jsx(MenuGroup, null, jsx(ShareMenuItem, {
325
- iconName: jsx(firstIntegration.Icon, null),
326
- labelId: messages.slackMenuItemText,
327
- onClickHandler: () => this.changeMenuItem('Slack')
328
- }), jsx(ShareMenuItem, {
329
- iconName: jsx(EmailIcon, {
330
- color: "currentColor",
331
- label: "",
332
- LEGACY_size: "medium",
333
- spacing: "spacious"
334
- }),
335
- labelId: messages.emailMenuItemText,
336
- onClickHandler: () => this.changeMenuItem('default')
337
- })));
338
- }
339
- }
340
- if (integrationMode === 'tabs') {
341
- const DEFAULT_TAB_CONTENT_WIDTH = isExtendedShareDialogEnabled ? 452 : 304;
342
- return jsx(Tabs, {
343
- id: "ShareForm-Tabs-Integrations",
344
- onChange: this.changeTab,
345
- selected: this.state.selectedTab
346
- }, jsx(TabList, null, jsx(Tab, {
347
- key: `share-tab-default`
348
- }, this.renderMainTabTitle()), shareIntegrations === null || shareIntegrations === void 0 ? void 0 : shareIntegrations.map(integration => jsx(Tab, {
349
- key: `share-tab-${integration.type}`
350
- }, jsx("div", {
351
- css: integrationWrapperStyles
352
- }, jsx("span", {
353
- css: integrationIconWrapperStyles
354
- }, jsx(integration.Icon, null)), integrationTabText(integration.type)))), fg('smart_links_for_plans_platform') && (additionalTabs === null || additionalTabs === void 0 ? void 0 : additionalTabs.map(tab => jsx(Tab, {
355
- key: `share-tab-${tab.label}`
356
- }, tab.label)))), jsx(TabPanel, {
357
- key: `share-tabPanel-default`
358
- }, jsx("div", {
359
- css: formWrapperStyles
360
- }, jsx("div", {
361
- style: {
362
- width: `${builtInTabContentWidth || DEFAULT_TAB_CONTENT_WIDTH}px`
363
- }
364
- }, this.renderShareForm()))), shareIntegrations === null || shareIntegrations === void 0 ? void 0 : shareIntegrations.map(integration => jsx(TabPanel, {
365
- key: `share-tabPanel-integration`
366
- }, jsx(AnalyticsContext, {
367
- data: {
368
- source: INTEGRATION_MODAL_SOURCE
369
- }
370
- }, jsx("div", {
371
- css: formWrapperStyles
372
- }, jsx("div", {
373
- style: {
374
- width: `${builtInTabContentWidth || DEFAULT_TAB_CONTENT_WIDTH}px`
375
- }
376
- }, jsx(IntegrationForm, {
377
- Content: integration.Content,
378
- onIntegrationClose: () => handleCloseDialog === null || handleCloseDialog === void 0 ? void 0 : handleCloseDialog(),
379
- changeTab: this.changeTab
380
- })))))), fg('smart_links_for_plans_platform') && (additionalTabs === null || additionalTabs === void 0 ? void 0 : additionalTabs.map(tab => jsx(TabPanel, {
381
- key: `share-tabPanel-${tab.label}`
382
- }, jsx("div", {
383
- css: formWrapperStyles
384
- }, jsx(IntegrationForm, {
385
- Content: tab.Content,
386
- onIntegrationClose: () => handleCloseDialog === null || handleCloseDialog === void 0 ? void 0 : handleCloseDialog(),
387
- changeTab: this.changeTab
388
- }))))));
389
- }
390
- }
391
- if (integrationMode === 'off' || !shareIntegrations || !shareIntegrations.length) {
313
+ const hasShareIntegrations = shareIntegrations && shareIntegrations.length;
314
+ const hasAdditionalTabs = additionalTabs && additionalTabs.length;
315
+ if (integrationMode === 'off' || !hasShareIntegrations && !hasAdditionalTabs) {
392
316
  return this.renderShareForm();
393
317
  }
394
- const firstIntegration = shareIntegrations[0];
395
318
  if (selectedMenuItem === 'default') {
396
319
  return this.renderShareForm();
397
320
  }
398
- if (selectedMenuItem === 'Slack') {
399
- return jsx(IntegrationForm, {
400
- Content: firstIntegration.Content,
401
- onIntegrationClose: () => handleCloseDialog === null || handleCloseDialog === void 0 ? void 0 : handleCloseDialog()
402
- });
403
- }
404
- if (integrationMode === 'menu') {
405
- return jsx(Box, {
406
- xcss: menuGroupContainerStyles
407
- }, jsx(MenuGroup, null, jsx(ShareMenuItem, {
408
- iconName: jsx(firstIntegration.Icon, null),
409
- labelId: messages.slackMenuItemText,
410
- onClickHandler: () => this.changeMenuItem('Slack')
411
- }), jsx(ShareMenuItem, {
412
- iconName: jsx(EmailIcon, {
413
- color: "currentColor",
414
- label: "",
415
- LEGACY_size: "medium",
416
- spacing: "spacious"
417
- }),
418
- labelId: messages.emailMenuItemText,
419
- onClickHandler: () => this.changeMenuItem('default')
420
- })));
321
+ if (hasShareIntegrations) {
322
+ const firstIntegration = shareIntegrations[0];
323
+ if (selectedMenuItem === 'Slack') {
324
+ return jsx(IntegrationForm, {
325
+ Content: firstIntegration.Content,
326
+ onIntegrationClose: () => handleCloseDialog === null || handleCloseDialog === void 0 ? void 0 : handleCloseDialog()
327
+ });
328
+ }
329
+ if (integrationMode === 'menu') {
330
+ return jsx(Box, {
331
+ xcss: menuGroupContainerStyles
332
+ }, jsx(MenuGroup, null, jsx(ShareMenuItem, {
333
+ iconName: jsx(firstIntegration.Icon, null),
334
+ labelId: messages.slackMenuItemText,
335
+ onClickHandler: () => this.changeMenuItem('Slack')
336
+ }), jsx(ShareMenuItem, {
337
+ iconName: jsx(EmailIcon, {
338
+ color: "currentColor",
339
+ label: "",
340
+ LEGACY_size: "medium",
341
+ spacing: "spacious"
342
+ }),
343
+ labelId: messages.emailMenuItemText,
344
+ onClickHandler: () => this.changeMenuItem('default')
345
+ })));
346
+ }
421
347
  }
422
348
  if (integrationMode === 'tabs') {
423
349
  const DEFAULT_TAB_CONTENT_WIDTH = isExtendedShareDialogEnabled ? 452 : 304;
@@ -427,13 +353,13 @@ class InternalForm extends React.PureComponent {
427
353
  selected: this.state.selectedTab
428
354
  }, jsx(TabList, null, jsx(Tab, {
429
355
  key: `share-tab-default`
430
- }, this.renderMainTabTitle()), jsx(Tab, {
431
- key: `share-tab-${firstIntegration.type}`
356
+ }, this.renderMainTabTitle()), shareIntegrations === null || shareIntegrations === void 0 ? void 0 : shareIntegrations.map(integration => jsx(Tab, {
357
+ key: `share-tab-${integration.type}`
432
358
  }, jsx("div", {
433
359
  css: integrationWrapperStyles
434
360
  }, jsx("span", {
435
361
  css: integrationIconWrapperStyles
436
- }, jsx(firstIntegration.Icon, null)), integrationTabText(firstIntegration.type))), fg('smart_links_for_plans_platform') && (additionalTabs === null || additionalTabs === void 0 ? void 0 : additionalTabs.map(tab => jsx(Tab, {
362
+ }, jsx(integration.Icon, null)), integrationTabText(integration.type)))), fg('smart_links_for_plans_platform') && (additionalTabs === null || additionalTabs === void 0 ? void 0 : additionalTabs.map(tab => jsx(Tab, {
437
363
  key: `share-tab-${tab.label}`
438
364
  }, tab.label)))), jsx(TabPanel, {
439
365
  key: `share-tabPanel-default`
@@ -443,7 +369,7 @@ class InternalForm extends React.PureComponent {
443
369
  style: {
444
370
  width: `${builtInTabContentWidth || DEFAULT_TAB_CONTENT_WIDTH}px`
445
371
  }
446
- }, this.renderShareForm()))), jsx(TabPanel, {
372
+ }, this.renderShareForm()))), shareIntegrations === null || shareIntegrations === void 0 ? void 0 : shareIntegrations.map(integration => jsx(TabPanel, {
447
373
  key: `share-tabPanel-integration`
448
374
  }, jsx(AnalyticsContext, {
449
375
  data: {
@@ -456,10 +382,10 @@ class InternalForm extends React.PureComponent {
456
382
  width: `${builtInTabContentWidth || DEFAULT_TAB_CONTENT_WIDTH}px`
457
383
  }
458
384
  }, jsx(IntegrationForm, {
459
- Content: firstIntegration.Content,
385
+ Content: integration.Content,
460
386
  onIntegrationClose: () => handleCloseDialog === null || handleCloseDialog === void 0 ? void 0 : handleCloseDialog(),
461
387
  changeTab: this.changeTab
462
- }))))), fg('smart_links_for_plans_platform') && (additionalTabs === null || additionalTabs === void 0 ? void 0 : additionalTabs.map(tab => jsx(TabPanel, {
388
+ })))))), fg('smart_links_for_plans_platform') && (additionalTabs === null || additionalTabs === void 0 ? void 0 : additionalTabs.map(tab => jsx(TabPanel, {
463
389
  key: `share-tabPanel-${tab.label}`
464
390
  }, jsx("div", {
465
391
  css: formWrapperStyles