@atlaskit/share 1.0.3 → 3.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (115) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/clients/package.json +7 -0
  3. package/dist/cjs/clients/ShareServiceClient.js +1 -7
  4. package/dist/cjs/clients/index.js +13 -0
  5. package/dist/cjs/components/CommentField.js +5 -4
  6. package/dist/cjs/components/CopyLinkButton.js +22 -17
  7. package/dist/cjs/components/ErrorBoundary.js +2 -0
  8. package/dist/cjs/components/IntegrationForm.js +11 -3
  9. package/dist/cjs/components/LazyShareForm/LazyShareForm.js +105 -0
  10. package/dist/cjs/components/LazyShareForm/index.js +15 -0
  11. package/dist/cjs/components/LazyShareForm/lazy.js +53 -0
  12. package/dist/cjs/components/LazyShareForm/styled.js +28 -0
  13. package/dist/cjs/components/ShareButton.js +2 -2
  14. package/dist/cjs/components/ShareDialogContainer.js +9 -8
  15. package/dist/cjs/components/ShareDialogWithTrigger.js +34 -45
  16. package/dist/cjs/components/ShareForm.js +31 -12
  17. package/dist/cjs/components/ShareFormWrapper/ShareFormWrapper.js +29 -0
  18. package/dist/cjs/components/ShareFormWrapper/index.js +15 -0
  19. package/dist/cjs/components/ShareFormWrapper/styled.js +31 -0
  20. package/dist/cjs/components/UserPickerField.js +8 -7
  21. package/dist/cjs/components/styles.js +1 -20
  22. package/dist/cjs/components/utils.js +2 -5
  23. package/dist/cjs/i18n.js +0 -10
  24. package/dist/cjs/index.js +0 -8
  25. package/dist/cjs/types/ShareDialogContainer.js +5 -0
  26. package/dist/cjs/types/ShareEntities.js +10 -1
  27. package/dist/cjs/types/ShareForm.js +5 -0
  28. package/dist/cjs/types/index.js +9 -1
  29. package/dist/cjs/util/i18n-util.js +3 -0
  30. package/dist/cjs/version.json +1 -1
  31. package/dist/es2019/clients/ShareServiceClient.js +1 -7
  32. package/dist/es2019/clients/index.js +1 -0
  33. package/dist/es2019/components/CommentField.js +3 -2
  34. package/dist/es2019/components/CopyLinkButton.js +16 -7
  35. package/dist/es2019/components/ErrorBoundary.js +2 -0
  36. package/dist/es2019/components/IntegrationForm.js +5 -3
  37. package/dist/es2019/components/LazyShareForm/LazyShareForm.js +92 -0
  38. package/dist/es2019/components/LazyShareForm/index.js +1 -0
  39. package/dist/es2019/components/LazyShareForm/lazy.js +26 -0
  40. package/dist/es2019/components/LazyShareForm/styled.js +16 -0
  41. package/dist/es2019/components/MessagesIntlProvider.js +1 -1
  42. package/dist/es2019/components/ShareButton.js +1 -1
  43. package/dist/es2019/components/ShareDialogContainer.js +6 -5
  44. package/dist/es2019/components/ShareDialogWithTrigger.js +33 -42
  45. package/dist/es2019/components/ShareForm.js +25 -8
  46. package/dist/es2019/components/ShareFormWrapper/ShareFormWrapper.js +14 -0
  47. package/dist/es2019/components/ShareFormWrapper/index.js +1 -0
  48. package/dist/es2019/components/ShareFormWrapper/styled.js +15 -0
  49. package/dist/es2019/components/UserPickerField.js +5 -4
  50. package/dist/es2019/components/styles.js +1 -15
  51. package/dist/es2019/components/utils.js +1 -3
  52. package/dist/es2019/i18n.js +0 -10
  53. package/dist/es2019/index.js +0 -1
  54. package/dist/es2019/types/ShareDialogContainer.js +1 -0
  55. package/dist/es2019/types/ShareEntities.js +7 -1
  56. package/dist/es2019/types/ShareForm.js +1 -0
  57. package/dist/es2019/types/index.js +2 -1
  58. package/dist/es2019/util/i18n-util.js +3 -0
  59. package/dist/es2019/version.json +1 -1
  60. package/dist/esm/clients/ShareServiceClient.js +1 -7
  61. package/dist/esm/clients/index.js +1 -0
  62. package/dist/esm/components/CommentField.js +3 -2
  63. package/dist/esm/components/CopyLinkButton.js +16 -7
  64. package/dist/esm/components/ErrorBoundary.js +2 -0
  65. package/dist/esm/components/IntegrationForm.js +11 -3
  66. package/dist/esm/components/LazyShareForm/LazyShareForm.js +87 -0
  67. package/dist/esm/components/LazyShareForm/index.js +1 -0
  68. package/dist/esm/components/LazyShareForm/lazy.js +31 -0
  69. package/dist/esm/components/LazyShareForm/styled.js +9 -0
  70. package/dist/esm/components/MessagesIntlProvider.js +1 -1
  71. package/dist/esm/components/ShareButton.js +1 -1
  72. package/dist/esm/components/ShareDialogContainer.js +6 -5
  73. package/dist/esm/components/ShareDialogWithTrigger.js +34 -38
  74. package/dist/esm/components/ShareForm.js +27 -7
  75. package/dist/esm/components/ShareFormWrapper/ShareFormWrapper.js +17 -0
  76. package/dist/esm/components/ShareFormWrapper/index.js +1 -0
  77. package/dist/esm/components/ShareFormWrapper/styled.js +15 -0
  78. package/dist/esm/components/UserPickerField.js +5 -4
  79. package/dist/esm/components/styles.js +1 -16
  80. package/dist/esm/components/utils.js +1 -3
  81. package/dist/esm/i18n.js +0 -10
  82. package/dist/esm/index.js +0 -1
  83. package/dist/esm/types/ShareDialogContainer.js +1 -0
  84. package/dist/esm/types/ShareEntities.js +7 -1
  85. package/dist/esm/types/ShareForm.js +1 -0
  86. package/dist/esm/types/index.js +2 -1
  87. package/dist/esm/util/i18n-util.js +3 -0
  88. package/dist/esm/version.json +1 -1
  89. package/dist/types/clients/ShareServiceClient.d.ts +2 -2
  90. package/dist/types/clients/index.d.ts +2 -0
  91. package/dist/types/components/CopyLinkButton.d.ts +1 -1
  92. package/dist/types/components/IntegrationForm.d.ts +5 -5
  93. package/dist/types/components/LazyShareForm/LazyShareForm.d.ts +19 -0
  94. package/dist/types/components/LazyShareForm/index.d.ts +1 -0
  95. package/dist/types/components/LazyShareForm/lazy.d.ts +4 -0
  96. package/dist/types/components/LazyShareForm/styled.d.ts +4 -0
  97. package/dist/types/components/ShareButton.d.ts +1 -1
  98. package/dist/types/components/ShareDialogContainer.d.ts +10 -149
  99. package/dist/types/components/ShareDialogWithTrigger.d.ts +10 -71
  100. package/dist/types/components/ShareForm.d.ts +5 -43
  101. package/dist/types/components/ShareFormWrapper/ShareFormWrapper.d.ts +9 -0
  102. package/dist/types/components/ShareFormWrapper/index.d.ts +1 -0
  103. package/dist/types/components/ShareFormWrapper/styled.d.ts +9 -0
  104. package/dist/types/components/UserPickerField.d.ts +1 -1
  105. package/dist/types/components/styles.d.ts +0 -7
  106. package/dist/types/i18n.d.ts +0 -10
  107. package/dist/types/index.d.ts +1 -4
  108. package/dist/types/types/ShareContentState.d.ts +2 -2
  109. package/dist/types/types/ShareDialogContainer.d.ts +142 -0
  110. package/dist/types/types/ShareDialogWithTrigger.d.ts +30 -3
  111. package/dist/types/types/ShareEntities.d.ts +5 -0
  112. package/dist/types/types/ShareForm.d.ts +31 -0
  113. package/dist/types/types/index.d.ts +5 -2
  114. package/docs/0-intro.tsx +4 -4
  115. package/package.json +28 -3
@@ -0,0 +1,16 @@
1
+ import styled from 'styled-components';
2
+ import { gridSize } from '@atlaskit/theme/constants';
3
+ export const BottomMessageWrapper = styled.div`
4
+ width: ${gridSize() * 44}px;
5
+ `;
6
+ export const CustomFooterWrapper = styled.div`
7
+ /* Must match inline dialog padding. */
8
+ margin: 0 ${-gridSize() * 3}px ${-gridSize() * 2}px ${-gridSize() * 3}px;
9
+ `;
10
+ export const SpinnerWrapper = styled.div`
11
+ widht: 100%;
12
+ height: 100%;
13
+ display: flex;
14
+ justify-content: center;
15
+ align-content: center;
16
+ `;
@@ -1,5 +1,5 @@
1
1
  import React, { useMemo } from 'react';
2
- import { IntlProvider, injectIntl } from 'react-intl-next';
2
+ import { injectIntl, IntlProvider } from 'react-intl-next';
3
3
  import { getMessagesForLocale } from '../util/i18n-util';
4
4
 
5
5
  const MessagesIntlProvider = ({
@@ -1,6 +1,6 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
- import Button from '@atlaskit/button/custom-theme-button';
3
2
  import React from 'react';
3
+ import Button from '@atlaskit/button/custom-theme-button';
4
4
  export const ShareButton = /*#__PURE__*/React.forwardRef(function ShareButton({
5
5
  text,
6
6
  ...props
@@ -1,18 +1,18 @@
1
1
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
- import { withAnalyticsEvents } from '@atlaskit/analytics-next';
3
- import memoizeOne from 'memoize-one';
4
2
  import React from 'react';
3
+ import deepEqual from 'fast-deep-equal';
4
+ import memoizeOne from 'memoize-one';
5
5
  import { FormattedMessage } from 'react-intl-next';
6
6
  import assert from 'tiny-invariant';
7
+ import { withAnalyticsEvents } from '@atlaskit/analytics-next';
7
8
  import { AtlassianUrlShortenerClient } from '../clients/AtlassianUrlShortenerClient';
8
9
  import { ShareServiceClient } from '../clients/ShareServiceClient';
9
10
  import { messages } from '../i18n';
10
11
  import { CHANNEL_ID, copyLinkButtonClicked, errorEncountered, shortUrlGenerated, shortUrlRequested } from './analytics';
12
+ import ErrorBoundary from './ErrorBoundary';
11
13
  import MessagesIntlProvider from './MessagesIntlProvider';
12
14
  import { ShareDialogWithTrigger } from './ShareDialogWithTrigger';
13
15
  import { optionDataToUsers } from './utils';
14
- import ErrorBoundary from './ErrorBoundary';
15
- import deepEqual from 'fast-deep-equal';
16
16
  const COPY_LINK_EVENT = copyLinkButtonClicked(0);
17
17
  export const defaultConfig = {
18
18
  disableSharingToEmails: false
@@ -26,6 +26,7 @@ function getCurrentPageUrl() {
26
26
  * This component serves as a Provider to provide customizable implementations
27
27
  * to ShareDialogTrigger component
28
28
  */
29
+ // eslint-disable-next-line @repo/internal/react/no-class-components
29
30
 
30
31
 
31
32
  export class ShareDialogContainerInternal extends React.Component {
@@ -53,7 +54,7 @@ export class ShareDialogContainerInternal extends React.Component {
53
54
  isFetchingConfig: true
54
55
  }, async () => {
55
56
  try {
56
- const config = await this.shareClient.getConfig(this.props.cloudId, this.props.enableEmailPermissionCheck);
57
+ const config = await this.shareClient.getConfig(this.props.cloudId);
57
58
 
58
59
  if (this._isMounted) {
59
60
  this.setState({
@@ -1,37 +1,27 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
3
- import { AnalyticsContext, withAnalyticsEvents } from '@atlaskit/analytics-next';
4
- import SplitButton from './SplitButton';
3
+ import React from 'react';
4
+ import { FormattedMessage, injectIntl } from 'react-intl-next';
5
+ import styled from 'styled-components';
6
+ import { withAnalyticsEvents } from '@atlaskit/analytics-next';
5
7
  import ShareIcon from '@atlaskit/icon/glyph/share';
6
8
  import Popup from '@atlaskit/popup';
7
9
  import Portal from '@atlaskit/portal';
10
+ import { layers } from '@atlaskit/theme/constants';
8
11
  import Aktooltip from '@atlaskit/tooltip';
9
- import { gridSize, layers } from '@atlaskit/theme/constants';
10
- import React from 'react';
11
- import { FormattedMessage, injectIntl } from 'react-intl-next';
12
- import styled from 'styled-components';
13
12
  import { messages } from '../i18n';
14
13
  import { OBJECT_SHARED } from '../types';
15
- import { cancelShare, CHANNEL_ID, copyLinkButtonClicked, formShareSubmitted, screenEvent, shareTriggerButtonClicked, shareSplitButtonEvent, ANALYTICS_SOURCE, shareTabClicked } from './analytics';
14
+ import { cancelShare, CHANNEL_ID, copyLinkButtonClicked, formShareSubmitted, screenEvent, shareSplitButtonEvent, shareTabClicked, shareTriggerButtonClicked // type TabSubjectIdType,
15
+ } from './analytics'; // eslint-disable-next-line no-duplicate-imports
16
+
17
+ import LazyShareFormLazy from './LazyShareForm/lazy';
16
18
  import ShareButton from './ShareButton';
17
- import { ShareForm } from './ShareForm';
19
+ import SplitButton from './SplitButton';
18
20
  import { generateSelectZIndex } from './utils';
19
- import { InlineDialogContentWrapper } from './styles';
20
- import { IntegrationForm } from './IntegrationForm';
21
21
  const ShareButtonWrapper = styled.div`
22
22
  display: inline-flex;
23
23
  outline: none;
24
24
  `;
25
- const InlineDialogFormWrapper = styled.div`
26
- width: 352px;
27
- `;
28
- const BottomMessageWrapper = styled.div`
29
- width: 352px;
30
- `;
31
- const CustomFooterWrapper = styled.div`
32
- /* Must match inline dialog padding. */
33
- margin: 0 ${-gridSize() * 3}px ${-gridSize() * 2}px ${-gridSize() * 3}px;
34
- `;
35
25
  export const defaultShareContentState = {
36
26
  users: [],
37
27
  comment: {
@@ -39,6 +29,7 @@ export const defaultShareContentState = {
39
29
  value: ''
40
30
  }
41
31
  };
32
+ // eslint-disable-next-line @repo/internal/react/no-class-components
42
33
  export class ShareDialogWithTriggerInternal extends React.PureComponent {
43
34
  constructor(...args) {
44
35
  super(...args);
@@ -425,48 +416,48 @@ export class ShareDialogWithTriggerInternal extends React.PureComponent {
425
416
  onKeyDown: this.handleKeyDown,
426
417
  style: style
427
418
  }, /*#__PURE__*/React.createElement(Popup, {
428
- content: () => /*#__PURE__*/React.createElement(AnalyticsContext, {
429
- data: {
430
- source: ANALYTICS_SOURCE
431
- }
432
- }, /*#__PURE__*/React.createElement(InlineDialogContentWrapper, {
433
- innerRef: this.containerRef
434
- }, showIntegrationForm && selectedIntegration !== null ? /*#__PURE__*/React.createElement(InlineDialogFormWrapper, null, /*#__PURE__*/React.createElement(IntegrationForm, {
435
- Content: selectedIntegration.Content,
436
- onIntegrationClose: this.handleCloseDialog
437
- })) : /*#__PURE__*/React.createElement(InlineDialogFormWrapper, null, /*#__PURE__*/React.createElement(ShareForm, {
419
+ content: () => /*#__PURE__*/React.createElement("div", {
420
+ ref: this.containerRef
421
+ }, /*#__PURE__*/React.createElement(LazyShareFormLazy, {
422
+ Content: selectedIntegration && selectedIntegration.Content,
423
+ selectedIntegration: selectedIntegration,
438
424
  copyLink: copyLink,
425
+ showIntegrationForm: showIntegrationForm,
426
+ bottomMessage: bottomMessage,
427
+ customFooter: customFooter,
439
428
  loadOptions: loadUserOptions,
440
429
  isSharing: isSharing,
441
- onSubmit: this.handleShareSubmit,
442
- title: shareFormTitle,
430
+ shareFormTitle: shareFormTitle,
443
431
  showTitle: integrationMode !== 'tabs' || !shareIntegrations || !shareIntegrations.length,
444
- onTabChange: this.onTabChange,
445
- helperMessage: shareFormHelperMessage,
432
+ shareFormHelperMessage: shareFormHelperMessage,
446
433
  shareError: shareError,
447
- onDismiss: this.handleFormDismiss,
448
434
  defaultValue: defaultValue,
449
435
  config: config,
450
436
  isFetchingConfig: isFetchingConfig,
451
- onLinkCopy: this.handleCopyLink,
452
437
  submitButtonLabel: submitButtonLabel,
453
438
  product: product,
454
439
  enableSmartUserPicker: enableSmartUserPicker,
455
440
  loggedInAccountId: loggedInAccountId,
456
441
  cloudId: cloudId,
457
442
  onUserSelectionChange: onUserSelectionChange,
458
- fieldsFooter: shareFieldsFooter,
459
- selectPortalRef: this.selectPortalRef,
443
+ shareFieldsFooter: shareFieldsFooter,
460
444
  isPublicLink: isPublicLink,
461
445
  copyTooltipText: copyTooltipText,
462
446
  integrationMode: integrationMode,
463
- handleCloseDialog: this.handleCloseDialog,
464
- shareIntegrations: shareIntegrations
465
- })), bottomMessage ? /*#__PURE__*/React.createElement(BottomMessageWrapper, null, bottomMessage) : null, customFooter && /*#__PURE__*/React.createElement(CustomFooterWrapper, null, customFooter))),
447
+ shareIntegrations: shareIntegrations // actions
448
+ ,
449
+ onLinkCopy: this.handleCopyLink,
450
+ onSubmit: this.handleShareSubmit,
451
+ onDismiss: this.handleFormDismiss,
452
+ onDialogClose: this.handleCloseDialog,
453
+ onTabChange: this.onTabChange //ref
454
+ ,
455
+ selectPortalRef: this.selectPortalRef
456
+ })),
466
457
  isOpen: isDialogOpen,
467
458
  onClose: this.handleCloseDialog,
468
459
  placement: dialogPlacement,
469
- trigger: triggerProps => this.renderShareTriggerButton(triggerProps),
460
+ trigger: this.renderShareTriggerButton,
470
461
  zIndex: dialogZIndex
471
462
  }), /*#__PURE__*/React.createElement(Portal, {
472
463
  zIndex: generateSelectZIndex(dialogZIndex)
@@ -1,21 +1,22 @@
1
1
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
2
  import _extends from "@babel/runtime/helpers/extends";
3
+ import React from 'react';
4
+ import { FormattedMessage, injectIntl } from 'react-intl-next';
5
+ import styled from 'styled-components';
3
6
  import Button from '@atlaskit/button/custom-theme-button';
4
7
  import Form from '@atlaskit/form';
5
8
  import ErrorIcon from '@atlaskit/icon/glyph/error';
9
+ import Tabs, { Tab, TabList, TabPanel } from '@atlaskit/tabs';
6
10
  import { R400 } from '@atlaskit/theme/colors';
7
11
  import { gridSize } from '@atlaskit/theme/constants';
8
12
  import Tooltip from '@atlaskit/tooltip';
9
- import Tabs, { Tab, TabList, TabPanel } from '@atlaskit/tabs';
10
- import React from 'react';
11
- import { FormattedMessage, injectIntl } from 'react-intl-next';
12
- import styled from 'styled-components';
13
13
  import { messages } from '../i18n';
14
+ import { TabType } from '../types';
14
15
  import { CommentField } from './CommentField';
15
16
  import CopyLinkButton from './CopyLinkButton';
17
+ import { IntegrationForm } from './IntegrationForm';
16
18
  import { ShareHeader } from './ShareHeader';
17
19
  import { UserPickerField } from './UserPickerField';
18
- import { IntegrationForm } from './IntegrationForm';
19
20
  const SubmitButtonWrapper = styled.div`
20
21
  display: flex;
21
22
  margin-left: auto;
@@ -60,10 +61,15 @@ const integrationTabText = integrationName => /*#__PURE__*/React.createElement(F
60
61
  }
61
62
  }));
62
63
 
64
+ // eslint-disable-next-line @repo/internal/react/no-class-components
63
65
  class InternalForm extends React.PureComponent {
64
66
  constructor(...args) {
65
67
  super(...args);
66
68
 
69
+ _defineProperty(this, "state", {
70
+ selectedTab: TabType.default
71
+ });
72
+
67
73
  _defineProperty(this, "renderShareForm", () => {
68
74
  const {
69
75
  formProps,
@@ -97,7 +103,7 @@ class InternalForm extends React.PureComponent {
97
103
  defaultValue: defaultValue && defaultValue.users,
98
104
  config: config,
99
105
  isLoading: isFetchingConfig,
100
- product: product,
106
+ product: product || 'confluence',
101
107
  enableSmartUserPicker: enableSmartUserPicker,
102
108
  loggedInAccountId: loggedInAccountId,
103
109
  cloudId: cloudId,
@@ -164,6 +170,12 @@ class InternalForm extends React.PureComponent {
164
170
  };
165
171
  return /*#__PURE__*/React.createElement(FormattedMessage, productShareType);
166
172
  });
173
+
174
+ _defineProperty(this, "changeTab", tab => {
175
+ this.setState({
176
+ selectedTab: tab
177
+ });
178
+ });
167
179
  }
168
180
 
169
181
  componentWillUnmount() {
@@ -195,8 +207,10 @@ class InternalForm extends React.PureComponent {
195
207
  return /*#__PURE__*/React.createElement(Tabs, {
196
208
  id: "ShareForm-Tabs-Integrations",
197
209
  onChange: index => {
210
+ this.changeTab(index);
198
211
  onTabChange === null || onTabChange === void 0 ? void 0 : onTabChange(index);
199
- }
212
+ },
213
+ selected: this.state.selectedTab
200
214
  }, /*#__PURE__*/React.createElement(TabList, null, /*#__PURE__*/React.createElement(Tab, {
201
215
  key: `share-tab-default`
202
216
  }, this.renderMainTabTitle()), /*#__PURE__*/React.createElement(Tab, {
@@ -211,7 +225,10 @@ class InternalForm extends React.PureComponent {
211
225
  isMainShare: false
212
226
  }, /*#__PURE__*/React.createElement(IntegrationForm, {
213
227
  Content: firstIntegration.Content,
214
- onIntegrationClose: () => handleCloseDialog === null || handleCloseDialog === void 0 ? void 0 : handleCloseDialog()
228
+ onIntegrationClose: () => handleCloseDialog === null || handleCloseDialog === void 0 ? void 0 : handleCloseDialog(),
229
+ changeTab: index => {
230
+ this.changeTab(index);
231
+ }
215
232
  }))));
216
233
  }
217
234
 
@@ -0,0 +1,14 @@
1
+ import React from 'react';
2
+ import { ShareHeader } from '../ShareHeader';
3
+ import { InlineDialogContentWrapper, InlineDialogFormWrapper } from './styled';
4
+
5
+ const ShareFormWrapper = ({
6
+ shareFormTitle,
7
+ shouldShowTitle,
8
+ children = null,
9
+ footer = null
10
+ }) => /*#__PURE__*/React.createElement(InlineDialogContentWrapper, null, /*#__PURE__*/React.createElement(InlineDialogFormWrapper, null, shouldShowTitle && /*#__PURE__*/React.createElement(ShareHeader, {
11
+ title: shareFormTitle
12
+ }), children), footer);
13
+
14
+ export default ShareFormWrapper;
@@ -0,0 +1 @@
1
+ export { default as ShareFormWrapper } from './ShareFormWrapper';
@@ -0,0 +1,15 @@
1
+ import styled from 'styled-components';
2
+ import { gridSize } from '@atlaskit/theme/constants';
3
+ export const InlineDialogFormWrapper = styled.div`
4
+ width: ${gridSize() * 44}px;
5
+ `;
6
+ /**
7
+ * Apply the same styling, as previous @atlaskit/inline-dialog had,
8
+ * compared to the @atlaskit/popup we are now using.
9
+ *
10
+ * packages/design-system/inline-dialog/src/InlineDialog/styled.ts:20:3
11
+ */
12
+
13
+ export const InlineDialogContentWrapper = styled.div`
14
+ padding: ${gridSize() * 2}px ${gridSize() * 3}px;
15
+ `;
@@ -1,12 +1,12 @@
1
1
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
2
  import _extends from "@babel/runtime/helpers/extends";
3
+ import React from 'react';
4
+ import { FormattedMessage, injectIntl } from 'react-intl-next';
3
5
  import { ErrorMessage, Field, HelperMessage } from '@atlaskit/form';
4
6
  import UserPicker, { isValidEmail, SmartUserPicker } from '@atlaskit/user-picker';
5
- import React from 'react';
6
- import { injectIntl, FormattedMessage } from 'react-intl-next';
7
7
  import { messages } from '../i18n';
8
- import { allowEmails, getMenuPortalTargetCurrentHTML } from './utils';
9
8
  import { MAX_PICKER_HEIGHT } from './styles';
9
+ import { allowEmails, getMenuPortalTargetCurrentHTML } from './utils';
10
10
  export const REQUIRED = 'REQUIRED';
11
11
  const DEBOUNCE_MS = 150;
12
12
 
@@ -58,7 +58,8 @@ const requiredMessagesWithoutEmail = {
58
58
  const getRequiredMessage = (product, allowEmail) => {
59
59
  const messages = allowEmail ? requiredMessagesWithEmail : requiredMessagesWithoutEmail;
60
60
  return messages[product];
61
- };
61
+ }; // eslint-disable-next-line @repo/internal/react/no-class-components
62
+
62
63
 
63
64
  export class UserPickerFieldComponent extends React.Component {
64
65
  constructor(...args) {
@@ -1,21 +1,7 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
- import React from 'react'; // AFP-2532 TODO: Fix automatic suppressions below
3
- // eslint-disable-next-line @atlassian/tangerine/import/entry-points
4
-
5
- import { gridSize } from '@atlaskit/theme/constants';
2
+ import React from 'react';
6
3
  import Button from '@atlaskit/button/custom-theme-button';
7
- import styled from 'styled-components';
8
4
  export const MAX_PICKER_HEIGHT = 102;
9
- /**
10
- * Apply the same styling, as previous @atlaskit/inline-dialog had,
11
- * compared to the @atlaskit/popup we are now using.
12
- *
13
- * packages/design-system/inline-dialog/src/InlineDialog/styled.ts:20:3
14
- */
15
-
16
- export const InlineDialogContentWrapper = styled.div`
17
- padding: ${gridSize() * 2}px ${gridSize() * 3}px;
18
- `;
19
5
  const StyledButton = /*#__PURE__*/React.forwardRef((props, ref) => /*#__PURE__*/React.createElement(Button, _extends({
20
6
  ref: ref
21
7
  }, props, {
@@ -1,6 +1,4 @@
1
- // AFP-2532 TODO: Fix automatic suppressions below
2
- // eslint-disable-next-line @atlassian/tangerine/import/entry-points
3
- import { layers } from '@atlaskit/theme';
1
+ import { layers } from '@atlaskit/theme/constants';
4
2
 
5
3
  /**
6
4
  * We need to generate correct zIndex, for the PopUp and for the Select inside it.
@@ -100,11 +100,6 @@ export const messages = defineMessages({
100
100
  defaultMessage: 'Invite',
101
101
  description: 'Button label for when the sharee action is set to "edit".'
102
102
  },
103
- copyLinkButtonIconLabel: {
104
- id: 'fabric.elements.share.copylink.button.icon.label',
105
- defaultMessage: 'Copy link icon',
106
- description: 'Default text for the aria-label of the copy Link icon'
107
- },
108
103
  copyLinkButtonText: {
109
104
  id: 'fabric.elements.share.copylink.button.text',
110
105
  defaultMessage: 'Copy link',
@@ -115,11 +110,6 @@ export const messages = defineMessages({
115
110
  defaultMessage: 'Copy public link',
116
111
  description: 'Default text for the Copy Link button when the link is public'
117
112
  },
118
- copiedToClipboardIconLabel: {
119
- id: 'fabric.elements.share.copied.to.clipboard.icon.label',
120
- defaultMessage: 'Copy link success icon',
121
- description: 'Default text for the aria-label of the copied link icon'
122
- },
123
113
  copiedToClipboardMessage: {
124
114
  id: 'fabric.elements.share.copied.to.clipboard.message',
125
115
  defaultMessage: 'Link copied to clipboard',
@@ -1,4 +1,3 @@
1
- export { ShareServiceClient } from './clients/ShareServiceClient';
2
1
  export { ShareDialogContainer } from './components/ShareDialogContainer';
3
2
  export { // Constants
4
3
  ADMIN_NOTIFIED, OBJECT_SHARED } from './types';
@@ -0,0 +1 @@
1
+ export {};
@@ -1 +1,7 @@
1
- export {};
1
+ // Third party integrations
2
+ export let TabType;
3
+
4
+ (function (TabType) {
5
+ TabType[TabType["default"] = 0] = "default";
6
+ TabType[TabType["Slack"] = 1] = "Slack";
7
+ })(TabType || (TabType = {}));
@@ -0,0 +1 @@
1
+ export {};
@@ -1 +1,2 @@
1
- export { ADMIN_NOTIFIED, OBJECT_SHARED } from './Flag';
1
+ export { ADMIN_NOTIFIED, OBJECT_SHARED } from './Flag';
2
+ export { TabType } from './ShareEntities';
@@ -1,3 +1,6 @@
1
+ // Cannot import from `../i18n` because there is `../i18n.tsx` file there.
2
+
3
+ /* eslint-disable @atlassian/tangerine/import/no-dangling-index */
1
4
  import { cs, da, de, en, en_GB, es, et, fi, fr, hu, is, it, ja, ko, nb, nl, pl, pt_BR, pt_PT, ro, ru, sk, sv, zh } from '../i18n/index';
2
5
  const localesMessagesMap = {
3
6
  cs,
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "name": "@atlaskit/share",
3
- "version": "1.0.3"
3
+ "version": "3.0.1"
4
4
  }
@@ -21,13 +21,7 @@ export var ShareServiceClient = /*#__PURE__*/function () {
21
21
 
22
22
  _createClass(ShareServiceClient, [{
23
23
  key: "getConfig",
24
- value: function getConfig(cloudId, enableEmailPermissionCheck) {
25
- if (!enableEmailPermissionCheck) {
26
- return Promise.resolve({
27
- disableSharingToEmails: false
28
- });
29
- }
30
-
24
+ value: function getConfig(cloudId) {
31
25
  var options = {
32
26
  path: SHARE_CONFIG_PATH,
33
27
  queryParams: {
@@ -0,0 +1 @@
1
+ export { ShareServiceClient } from './ShareServiceClient';
@@ -1,8 +1,9 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
+ import React from 'react';
3
+ import { useIntl } from 'react-intl-next'; // eslint-disable-next-line @atlaskit/design-system/no-deprecated-imports
4
+
2
5
  import FieldTextArea from '@atlaskit/field-text-area';
3
6
  import { Field } from '@atlaskit/form';
4
- import React from 'react';
5
- import { useIntl } from 'react-intl-next';
6
7
  import { messages } from '../i18n';
7
8
  export var CommentField = function CommentField(_ref) {
8
9
  var defaultValue = _ref.defaultValue;
@@ -14,17 +14,19 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
14
14
 
15
15
  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; } }
16
16
 
17
+ import React from 'react';
18
+ import { isSafari } from 'react-device-detect';
19
+ import { FormattedMessage, injectIntl } from 'react-intl-next';
20
+ import styled from 'styled-components';
17
21
  import CheckCircleIcon from '@atlaskit/icon/glyph/check-circle';
18
22
  import LinkFilledIcon from '@atlaskit/icon/glyph/link-filled';
19
23
  import Popup from '@atlaskit/popup';
20
24
  import { G300 } from '@atlaskit/theme/colors';
21
25
  import { layers } from '@atlaskit/theme/constants';
22
26
  import Tooltip from '@atlaskit/tooltip';
23
- import React from 'react';
24
- import { FormattedMessage, injectIntl } from 'react-intl-next';
25
- import styled from 'styled-components';
26
- import Button, { InlineDialogContentWrapper } from './styles';
27
27
  import { messages } from '../i18n';
28
+ import { InlineDialogContentWrapper } from './ShareFormWrapper/styled';
29
+ import Button from './styles';
28
30
  var Z_INDEX = layers.modal();
29
31
  var AUTO_DISMISS_SECONDS = 8;
30
32
  export var AUTO_DISMISS_MS = AUTO_DISMISS_SECONDS * 1000;
@@ -37,11 +39,14 @@ function (props, ref) {
37
39
  position: 'absolute',
38
40
  left: '-9999px'
39
41
  },
42
+ tabIndex: -1,
43
+ "aria-hidden": true,
40
44
  ref: ref,
41
45
  value: props.text,
42
46
  readOnly: true
43
47
  });
44
48
  });
49
+ // eslint-disable-next-line @repo/internal/react/no-class-components
45
50
  export var CopyLinkButton = /*#__PURE__*/function (_React$Component) {
46
51
  _inherits(CopyLinkButton, _React$Component);
47
52
 
@@ -107,10 +112,11 @@ export var CopyLinkButton = /*#__PURE__*/function (_React$Component) {
107
112
  isDisabled = _this$props.isDisabled,
108
113
  isPublicLink = _this$props.isPublicLink;
109
114
  return /*#__PURE__*/React.createElement(Button, _extends({
115
+ "aria-label": formatMessage(isPublicLink ? messages.copyPublicLinkButtonText : messages.copyLinkButtonText),
110
116
  isDisabled: isDisabled,
111
117
  appearance: "subtle-link",
112
118
  iconBefore: /*#__PURE__*/React.createElement(LinkFilledIcon, {
113
- label: formatMessage(messages.copyLinkButtonIconLabel),
119
+ label: "",
114
120
  size: "medium"
115
121
  }),
116
122
  onClick: _this.handleClick
@@ -134,14 +140,17 @@ export var CopyLinkButton = /*#__PURE__*/function (_React$Component) {
134
140
  var _this$props2 = this.props,
135
141
  formatMessage = _this$props2.intl.formatMessage,
136
142
  copyTooltipText = _this$props2.copyTooltipText;
137
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(HiddenInput, {
143
+ return /*#__PURE__*/React.createElement(React.Fragment, null, isSafari && /*#__PURE__*/React.createElement("div", {
144
+ className: "assistive",
145
+ "aria-live": "assertive"
146
+ }, shouldShowCopiedMessage && formatMessage(messages.copiedToClipboardMessage)), /*#__PURE__*/React.createElement(HiddenInput, {
138
147
  ref: this.inputRef,
139
148
  text: this.props.link
140
149
  }), /*#__PURE__*/React.createElement(Popup, {
141
150
  zIndex: Z_INDEX,
142
151
  content: function content() {
143
152
  return /*#__PURE__*/React.createElement(InlineDialogContentWrapper, null, /*#__PURE__*/React.createElement(MessageContainer, null, /*#__PURE__*/React.createElement(CheckCircleIcon, {
144
- label: formatMessage(messages.copiedToClipboardIconLabel),
153
+ label: "",
145
154
  primaryColor: G300
146
155
  }), /*#__PURE__*/React.createElement(MessageSpan, null, /*#__PURE__*/React.createElement(FormattedMessage, messages.copiedToClipboardMessage))));
147
156
  },
@@ -14,6 +14,8 @@ import React from 'react';
14
14
  import { withAnalyticsEvents } from '@atlaskit/analytics-next';
15
15
  import { CHANNEL_ID, errorEncountered } from './analytics';
16
16
 
17
+ // ErrorBoundary does not support in functional component
18
+ // eslint-disable-next-line @repo/internal/react/no-class-components
17
19
  var ErrorBoundary = /*#__PURE__*/function (_React$Component) {
18
20
  _inherits(ErrorBoundary, _React$Component);
19
21
 
@@ -8,8 +8,16 @@ import { h500 } from '@atlaskit/theme/typography';
8
8
  export var FormWrapper = styled.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n [class^='FormHeader__FormHeaderWrapper'] {\n h1:first-child {\n ", "\n\n > span {\n /* jira has a class override font settings on h1 > span in gh-custom-field-pickers.css */\n font-size: inherit !important;\n line-height: inherit !important;\n letter-spacing: inherit !important;\n }\n }\n }\n\n [class^='FormSection__FormSectionWrapper'] {\n margin-top: 0px;\n }\n\n [class^='FormFooter__FormFooterWrapper'] {\n justify-content: space-between;\n margin-top: 12px;\n margin-bottom: 24px;\n }\n\n [class^='Field__FieldWrapper']:not(:first-child) {\n margin-top: 12px;\n }\n"])), h500());
9
9
  export var IntegrationForm = function IntegrationForm(_ref) {
10
10
  var Content = _ref.Content,
11
- onIntegrationClose = _ref.onIntegrationClose;
12
- return /*#__PURE__*/React.createElement(FormWrapper, null, /*#__PURE__*/React.createElement(Content, {
13
- onClose: onIntegrationClose
11
+ _ref$onIntegrationClo = _ref.onIntegrationClose,
12
+ onIntegrationClose = _ref$onIntegrationClo === void 0 ? function () {
13
+ return undefined;
14
+ } : _ref$onIntegrationClo,
15
+ _ref$changeTab = _ref.changeTab,
16
+ changeTab = _ref$changeTab === void 0 ? function () {
17
+ return undefined;
18
+ } : _ref$changeTab;
19
+ return /*#__PURE__*/React.createElement(FormWrapper, null, Content && /*#__PURE__*/React.createElement(Content, {
20
+ onClose: onIntegrationClose,
21
+ changeTab: changeTab
14
22
  }));
15
23
  };