@atlaskit/share 3.0.0 → 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 (68) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/dist/cjs/components/CommentField.js +5 -4
  3. package/dist/cjs/components/CopyLinkButton.js +11 -10
  4. package/dist/cjs/components/ErrorBoundary.js +2 -0
  5. package/dist/cjs/components/IntegrationForm.js +7 -2
  6. package/dist/cjs/components/LazyShareForm/LazyShareForm.js +3 -3
  7. package/dist/cjs/components/LazyShareForm/lazy.js +2 -2
  8. package/dist/cjs/components/ShareButton.js +2 -2
  9. package/dist/cjs/components/ShareDialogContainer.js +8 -7
  10. package/dist/cjs/components/ShareDialogWithTrigger.js +10 -9
  11. package/dist/cjs/components/ShareForm.js +28 -9
  12. package/dist/cjs/components/ShareFormWrapper/ShareFormWrapper.js +2 -2
  13. package/dist/cjs/components/UserPickerField.js +8 -7
  14. package/dist/cjs/components/utils.js +2 -5
  15. package/dist/cjs/types/ShareEntities.js +10 -1
  16. package/dist/cjs/types/index.js +9 -1
  17. package/dist/cjs/util/i18n-util.js +3 -0
  18. package/dist/cjs/version.json +1 -1
  19. package/dist/es2019/components/CommentField.js +3 -2
  20. package/dist/es2019/components/CopyLinkButton.js +6 -5
  21. package/dist/es2019/components/ErrorBoundary.js +2 -0
  22. package/dist/es2019/components/IntegrationForm.js +4 -2
  23. package/dist/es2019/components/LazyShareForm/LazyShareForm.js +2 -2
  24. package/dist/es2019/components/LazyShareForm/lazy.js +2 -2
  25. package/dist/es2019/components/MessagesIntlProvider.js +1 -1
  26. package/dist/es2019/components/ShareButton.js +1 -1
  27. package/dist/es2019/components/ShareDialogContainer.js +5 -4
  28. package/dist/es2019/components/ShareDialogWithTrigger.js +9 -6
  29. package/dist/es2019/components/ShareForm.js +23 -6
  30. package/dist/es2019/components/ShareFormWrapper/ShareFormWrapper.js +1 -1
  31. package/dist/es2019/components/UserPickerField.js +5 -4
  32. package/dist/es2019/components/utils.js +1 -3
  33. package/dist/es2019/types/ShareEntities.js +7 -1
  34. package/dist/es2019/types/index.js +2 -1
  35. package/dist/es2019/util/i18n-util.js +3 -0
  36. package/dist/es2019/version.json +1 -1
  37. package/dist/esm/components/CommentField.js +3 -2
  38. package/dist/esm/components/CopyLinkButton.js +6 -5
  39. package/dist/esm/components/ErrorBoundary.js +2 -0
  40. package/dist/esm/components/IntegrationForm.js +7 -2
  41. package/dist/esm/components/LazyShareForm/LazyShareForm.js +2 -2
  42. package/dist/esm/components/LazyShareForm/lazy.js +2 -2
  43. package/dist/esm/components/MessagesIntlProvider.js +1 -1
  44. package/dist/esm/components/ShareButton.js +1 -1
  45. package/dist/esm/components/ShareDialogContainer.js +5 -4
  46. package/dist/esm/components/ShareDialogWithTrigger.js +9 -6
  47. package/dist/esm/components/ShareForm.js +25 -5
  48. package/dist/esm/components/ShareFormWrapper/ShareFormWrapper.js +1 -1
  49. package/dist/esm/components/UserPickerField.js +5 -4
  50. package/dist/esm/components/utils.js +1 -3
  51. package/dist/esm/types/ShareEntities.js +7 -1
  52. package/dist/esm/types/index.js +2 -1
  53. package/dist/esm/util/i18n-util.js +3 -0
  54. package/dist/esm/version.json +1 -1
  55. package/dist/types/components/CopyLinkButton.d.ts +1 -1
  56. package/dist/types/components/IntegrationForm.d.ts +2 -1
  57. package/dist/types/components/LazyShareForm/LazyShareForm.d.ts +1 -1
  58. package/dist/types/components/ShareButton.d.ts +1 -1
  59. package/dist/types/components/ShareDialogContainer.d.ts +2 -3
  60. package/dist/types/components/ShareDialogWithTrigger.d.ts +2 -2
  61. package/dist/types/components/ShareForm.d.ts +4 -1
  62. package/dist/types/components/UserPickerField.d.ts +1 -1
  63. package/dist/types/types/ShareDialogContainer.d.ts +4 -4
  64. package/dist/types/types/ShareEntities.d.ts +5 -0
  65. package/dist/types/types/ShareForm.d.ts +2 -2
  66. package/dist/types/types/index.d.ts +1 -0
  67. package/docs/0-intro.tsx +4 -4
  68. package/package.json +23 -2
@@ -1,21 +1,23 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
3
3
  import React from 'react';
4
+ import { FormattedMessage, injectIntl } from 'react-intl-next';
5
+ import styled from 'styled-components';
4
6
  import { withAnalyticsEvents } from '@atlaskit/analytics-next';
5
- import SplitButton from './SplitButton';
6
7
  import ShareIcon from '@atlaskit/icon/glyph/share';
7
8
  import Popup from '@atlaskit/popup';
8
9
  import Portal from '@atlaskit/portal';
9
- import Aktooltip from '@atlaskit/tooltip';
10
10
  import { layers } from '@atlaskit/theme/constants';
11
- import { FormattedMessage, injectIntl } from 'react-intl-next';
12
- import styled from 'styled-components';
11
+ import Aktooltip from '@atlaskit/tooltip';
13
12
  import { messages } from '../i18n';
14
13
  import { OBJECT_SHARED } from '../types';
15
- import { cancelShare, CHANNEL_ID, copyLinkButtonClicked, screenEvent, shareTriggerButtonClicked, shareSplitButtonEvent, shareTabClicked, formShareSubmitted } 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';
19
+ import SplitButton from './SplitButton';
17
20
  import { generateSelectZIndex } from './utils';
18
- import LazyShareFormLazy from './LazyShareForm/lazy';
19
21
  const ShareButtonWrapper = styled.div`
20
22
  display: inline-flex;
21
23
  outline: none;
@@ -27,6 +29,7 @@ export const defaultShareContentState = {
27
29
  value: ''
28
30
  }
29
31
  };
32
+ // eslint-disable-next-line @repo/internal/react/no-class-components
30
33
  export class ShareDialogWithTriggerInternal extends React.PureComponent {
31
34
  constructor(...args) {
32
35
  super(...args);
@@ -1,21 +1,22 @@
1
1
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
2
  import _extends from "@babel/runtime/helpers/extends";
3
3
  import React from 'react';
4
+ import { FormattedMessage, injectIntl } from 'react-intl-next';
5
+ import styled from 'styled-components';
4
6
  import Button from '@atlaskit/button/custom-theme-button';
5
7
  import Form from '@atlaskit/form';
6
8
  import ErrorIcon from '@atlaskit/icon/glyph/error';
9
+ import Tabs, { Tab, TabList, TabPanel } from '@atlaskit/tabs';
7
10
  import { R400 } from '@atlaskit/theme/colors';
8
11
  import { gridSize } from '@atlaskit/theme/constants';
9
12
  import Tooltip from '@atlaskit/tooltip';
10
- import Tabs, { Tab, TabList, TabPanel } from '@atlaskit/tabs';
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,
@@ -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
 
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
- import { InlineDialogFormWrapper, InlineDialogContentWrapper } from './styled';
3
2
  import { ShareHeader } from '../ShareHeader';
3
+ import { InlineDialogContentWrapper, InlineDialogFormWrapper } from './styled';
4
4
 
5
5
  const ShareFormWrapper = ({
6
6
  shareFormTitle,
@@ -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,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.
@@ -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 = {}));
@@ -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": "3.0.0"
3
+ "version": "3.0.1"
4
4
  }
@@ -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,19 +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 { isSafari } from 'react-device-detect';
26
- import styled from 'styled-components';
27
- import Button from './styles';
28
27
  import { messages } from '../i18n';
29
28
  import { InlineDialogContentWrapper } from './ShareFormWrapper/styled';
29
+ import Button from './styles';
30
30
  var Z_INDEX = layers.modal();
31
31
  var AUTO_DISMISS_SECONDS = 8;
32
32
  export var AUTO_DISMISS_MS = AUTO_DISMISS_SECONDS * 1000;
@@ -46,6 +46,7 @@ function (props, ref) {
46
46
  readOnly: true
47
47
  });
48
48
  });
49
+ // eslint-disable-next-line @repo/internal/react/no-class-components
49
50
  export var CopyLinkButton = /*#__PURE__*/function (_React$Component) {
50
51
  _inherits(CopyLinkButton, _React$Component);
51
52
 
@@ -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
 
@@ -11,8 +11,13 @@ export var IntegrationForm = function IntegrationForm(_ref) {
11
11
  _ref$onIntegrationClo = _ref.onIntegrationClose,
12
12
  onIntegrationClose = _ref$onIntegrationClo === void 0 ? function () {
13
13
  return undefined;
14
- } : _ref$onIntegrationClo;
14
+ } : _ref$onIntegrationClo,
15
+ _ref$changeTab = _ref.changeTab,
16
+ changeTab = _ref$changeTab === void 0 ? function () {
17
+ return undefined;
18
+ } : _ref$changeTab;
15
19
  return /*#__PURE__*/React.createElement(FormWrapper, null, Content && /*#__PURE__*/React.createElement(Content, {
16
- onClose: onIntegrationClose
20
+ onClose: onIntegrationClose,
21
+ changeTab: changeTab
17
22
  }));
18
23
  };
@@ -1,10 +1,10 @@
1
1
  import React from 'react';
2
2
  import { AnalyticsContext } from '@atlaskit/analytics-next';
3
- import { ShareForm } from '../ShareForm';
4
3
  import { ANALYTICS_SOURCE } from '../analytics';
5
4
  import { IntegrationForm } from '../IntegrationForm';
6
- import { BottomMessageWrapper, CustomFooterWrapper } from './styled';
5
+ import { ShareForm } from '../ShareForm';
7
6
  import { ShareFormWrapper } from '../ShareFormWrapper';
7
+ import { BottomMessageWrapper, CustomFooterWrapper } from './styled';
8
8
 
9
9
  /**
10
10
  * A Share form content which is lazy-loaded.
@@ -1,8 +1,8 @@
1
1
  import React from 'react';
2
- import { LazySuspense, lazyForPaint } from 'react-loosely-lazy';
2
+ import { lazyForPaint, LazySuspense } from 'react-loosely-lazy';
3
3
  import Spinner from '@atlaskit/spinner';
4
- import { SpinnerWrapper } from './styled';
5
4
  import { ShareFormWrapper } from '../ShareFormWrapper';
5
+ import { SpinnerWrapper } from './styled';
6
6
  var LazyShareFormLazy = lazyForPaint(function () {
7
7
  return import(
8
8
  /* webpackChunkName: "@atlaskit-internal_share-form" */
@@ -5,7 +5,7 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
5
5
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
6
6
 
7
7
  import React, { useMemo } from 'react';
8
- import { IntlProvider, injectIntl } from 'react-intl-next';
8
+ import { injectIntl, IntlProvider } from 'react-intl-next';
9
9
  import { getMessagesForLocale } from '../util/i18n-util';
10
10
 
11
11
  var MessagesIntlProvider = function MessagesIntlProvider(_ref) {
@@ -1,7 +1,7 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
3
- import Button from '@atlaskit/button/custom-theme-button';
4
3
  import React from 'react';
4
+ import Button from '@atlaskit/button/custom-theme-button';
5
5
  export var ShareButton = /*#__PURE__*/React.forwardRef(function ShareButton(_ref, ref) {
6
6
  var text = _ref.text,
7
7
  props = _objectWithoutProperties(_ref, ["text"]);
@@ -16,20 +16,20 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
16
16
 
17
17
  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; } }
18
18
 
19
- import { withAnalyticsEvents } from '@atlaskit/analytics-next';
20
- import memoizeOne from 'memoize-one';
21
19
  import React from 'react';
20
+ import deepEqual from 'fast-deep-equal';
21
+ import memoizeOne from 'memoize-one';
22
22
  import { FormattedMessage } from 'react-intl-next';
23
23
  import assert from 'tiny-invariant';
24
+ import { withAnalyticsEvents } from '@atlaskit/analytics-next';
24
25
  import { AtlassianUrlShortenerClient } from '../clients/AtlassianUrlShortenerClient';
25
26
  import { ShareServiceClient } from '../clients/ShareServiceClient';
26
27
  import { messages } from '../i18n';
27
28
  import { CHANNEL_ID, copyLinkButtonClicked, errorEncountered, shortUrlGenerated, shortUrlRequested } from './analytics';
29
+ import ErrorBoundary from './ErrorBoundary';
28
30
  import MessagesIntlProvider from './MessagesIntlProvider';
29
31
  import { ShareDialogWithTrigger } from './ShareDialogWithTrigger';
30
32
  import { optionDataToUsers } from './utils';
31
- import ErrorBoundary from './ErrorBoundary';
32
- import deepEqual from 'fast-deep-equal';
33
33
  var COPY_LINK_EVENT = copyLinkButtonClicked(0);
34
34
  export var defaultConfig = {
35
35
  disableSharingToEmails: false
@@ -45,6 +45,7 @@ function getCurrentPageUrl() {
45
45
  * This component serves as a Provider to provide customizable implementations
46
46
  * to ShareDialogTrigger component
47
47
  */
48
+ // eslint-disable-next-line @repo/internal/react/no-class-components
48
49
 
49
50
 
50
51
  export var ShareDialogContainerInternal = /*#__PURE__*/function (_React$Component) {
@@ -19,21 +19,23 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
19
19
  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
20
 
21
21
  import React from 'react';
22
+ import { FormattedMessage, injectIntl } from 'react-intl-next';
23
+ import styled from 'styled-components';
22
24
  import { withAnalyticsEvents } from '@atlaskit/analytics-next';
23
- import SplitButton from './SplitButton';
24
25
  import ShareIcon from '@atlaskit/icon/glyph/share';
25
26
  import Popup from '@atlaskit/popup';
26
27
  import Portal from '@atlaskit/portal';
27
- import Aktooltip from '@atlaskit/tooltip';
28
28
  import { layers } from '@atlaskit/theme/constants';
29
- import { FormattedMessage, injectIntl } from 'react-intl-next';
30
- import styled from 'styled-components';
29
+ import Aktooltip from '@atlaskit/tooltip';
31
30
  import { messages } from '../i18n';
32
31
  import { OBJECT_SHARED } from '../types';
33
- import { cancelShare, CHANNEL_ID, copyLinkButtonClicked, screenEvent, shareTriggerButtonClicked, shareSplitButtonEvent, shareTabClicked, formShareSubmitted } from './analytics';
32
+ import { cancelShare, CHANNEL_ID, copyLinkButtonClicked, formShareSubmitted, screenEvent, shareSplitButtonEvent, shareTabClicked, shareTriggerButtonClicked // type TabSubjectIdType,
33
+ } from './analytics'; // eslint-disable-next-line no-duplicate-imports
34
+
35
+ import LazyShareFormLazy from './LazyShareForm/lazy';
34
36
  import ShareButton from './ShareButton';
37
+ import SplitButton from './SplitButton';
35
38
  import { generateSelectZIndex } from './utils';
36
- import LazyShareFormLazy from './LazyShareForm/lazy';
37
39
  var ShareButtonWrapper = styled.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: inline-flex;\n outline: none;\n"])));
38
40
  export var defaultShareContentState = {
39
41
  users: [],
@@ -42,6 +44,7 @@ export var defaultShareContentState = {
42
44
  value: ''
43
45
  }
44
46
  };
47
+ // eslint-disable-next-line @repo/internal/react/no-class-components
45
48
  export var ShareDialogWithTriggerInternal = /*#__PURE__*/function (_React$PureComponent) {
46
49
  _inherits(ShareDialogWithTriggerInternal, _React$PureComponent);
47
50
 
@@ -19,21 +19,22 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
19
19
  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
20
 
21
21
  import React from 'react';
22
+ import { FormattedMessage, injectIntl } from 'react-intl-next';
23
+ import styled from 'styled-components';
22
24
  import Button from '@atlaskit/button/custom-theme-button';
23
25
  import Form from '@atlaskit/form';
24
26
  import ErrorIcon from '@atlaskit/icon/glyph/error';
27
+ import Tabs, { Tab, TabList, TabPanel } from '@atlaskit/tabs';
25
28
  import { R400 } from '@atlaskit/theme/colors';
26
29
  import { gridSize } from '@atlaskit/theme/constants';
27
30
  import Tooltip from '@atlaskit/tooltip';
28
- import Tabs, { Tab, TabList, TabPanel } from '@atlaskit/tabs';
29
- import { FormattedMessage, injectIntl } from 'react-intl-next';
30
- import styled from 'styled-components';
31
31
  import { messages } from '../i18n';
32
+ import { TabType } from '../types';
32
33
  import { CommentField } from './CommentField';
33
34
  import CopyLinkButton from './CopyLinkButton';
35
+ import { IntegrationForm } from './IntegrationForm';
34
36
  import { ShareHeader } from './ShareHeader';
35
37
  import { UserPickerField } from './UserPickerField';
36
- import { IntegrationForm } from './IntegrationForm';
37
38
  var SubmitButtonWrapper = styled.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n margin-left: auto;\n"])));
38
39
  var CenterAlignedIconWrapper = styled.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n display: flex;\n align-self: center;\n padding: 0 10px;\n\n > div {\n line-height: 1;\n }\n"])));
39
40
  export var FormWrapper = styled.div(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n margin-top: ", "px;\n width: 100%;\n\n /* jira has a class override font settings on h1 in gh-custom-field-pickers.css */\n #ghx-modes-tools #ghx-share & h1:first-child {\n margin-top: 0;\n }\n"])), function (props) {
@@ -52,6 +53,7 @@ var integrationTabText = function integrationTabText(integrationName) {
52
53
  }));
53
54
  };
54
55
 
56
+ // eslint-disable-next-line @repo/internal/react/no-class-components
55
57
  var InternalForm = /*#__PURE__*/function (_React$PureComponent) {
56
58
  _inherits(InternalForm, _React$PureComponent);
57
59
 
@@ -68,6 +70,10 @@ var InternalForm = /*#__PURE__*/function (_React$PureComponent) {
68
70
 
69
71
  _this = _super.call.apply(_super, [this].concat(args));
70
72
 
73
+ _defineProperty(_assertThisInitialized(_this), "state", {
74
+ selectedTab: TabType.default
75
+ });
76
+
71
77
  _defineProperty(_assertThisInitialized(_this), "renderShareForm", function () {
72
78
  var _this$props = _this.props,
73
79
  formProps = _this$props.formProps,
@@ -163,6 +169,12 @@ var InternalForm = /*#__PURE__*/function (_React$PureComponent) {
163
169
  return /*#__PURE__*/React.createElement(FormattedMessage, productShareType);
164
170
  });
165
171
 
172
+ _defineProperty(_assertThisInitialized(_this), "changeTab", function (tab) {
173
+ _this.setState({
174
+ selectedTab: tab
175
+ });
176
+ });
177
+
166
178
  return _this;
167
179
  }
168
180
 
@@ -180,6 +192,8 @@ var InternalForm = /*#__PURE__*/function (_React$PureComponent) {
180
192
  }, {
181
193
  key: "render",
182
194
  value: function render() {
195
+ var _this2 = this;
196
+
183
197
  var _this$props5 = this.props,
184
198
  _this$props5$integrat = _this$props5.integrationMode,
185
199
  integrationMode = _this$props5$integrat === void 0 ? 'off' : _this$props5$integrat,
@@ -197,8 +211,11 @@ var InternalForm = /*#__PURE__*/function (_React$PureComponent) {
197
211
  return /*#__PURE__*/React.createElement(Tabs, {
198
212
  id: "ShareForm-Tabs-Integrations",
199
213
  onChange: function onChange(index) {
214
+ _this2.changeTab(index);
215
+
200
216
  onTabChange === null || onTabChange === void 0 ? void 0 : onTabChange(index);
201
- }
217
+ },
218
+ selected: this.state.selectedTab
202
219
  }, /*#__PURE__*/React.createElement(TabList, null, /*#__PURE__*/React.createElement(Tab, {
203
220
  key: "share-tab-default"
204
221
  }, this.renderMainTabTitle()), /*#__PURE__*/React.createElement(Tab, {
@@ -215,6 +232,9 @@ var InternalForm = /*#__PURE__*/function (_React$PureComponent) {
215
232
  Content: firstIntegration.Content,
216
233
  onIntegrationClose: function onIntegrationClose() {
217
234
  return handleCloseDialog === null || handleCloseDialog === void 0 ? void 0 : handleCloseDialog();
235
+ },
236
+ changeTab: function changeTab(index) {
237
+ _this2.changeTab(index);
218
238
  }
219
239
  }))));
220
240
  }
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
- import { InlineDialogFormWrapper, InlineDialogContentWrapper } from './styled';
3
2
  import { ShareHeader } from '../ShareHeader';
3
+ import { InlineDialogContentWrapper, InlineDialogFormWrapper } from './styled';
4
4
 
5
5
  var ShareFormWrapper = function ShareFormWrapper(_ref) {
6
6
  var shareFormTitle = _ref.shareFormTitle,
@@ -11,13 +11,13 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
11
11
 
12
12
  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; } }
13
13
 
14
+ import React from 'react';
15
+ import { FormattedMessage, injectIntl } from 'react-intl-next';
14
16
  import { ErrorMessage, Field, HelperMessage } from '@atlaskit/form';
15
17
  import UserPicker, { isValidEmail, SmartUserPicker } from '@atlaskit/user-picker';
16
- import React from 'react';
17
- import { injectIntl, FormattedMessage } from 'react-intl-next';
18
18
  import { messages } from '../i18n';
19
- import { allowEmails, getMenuPortalTargetCurrentHTML } from './utils';
20
19
  import { MAX_PICKER_HEIGHT } from './styles';
20
+ import { allowEmails, getMenuPortalTargetCurrentHTML } from './utils';
21
21
  export var REQUIRED = 'REQUIRED';
22
22
  var DEBOUNCE_MS = 150;
23
23
 
@@ -75,7 +75,8 @@ var requiredMessagesWithoutEmail = {
75
75
  var getRequiredMessage = function getRequiredMessage(product, allowEmail) {
76
76
  var messages = allowEmail ? requiredMessagesWithEmail : requiredMessagesWithoutEmail;
77
77
  return messages[product];
78
- };
78
+ }; // eslint-disable-next-line @repo/internal/react/no-class-components
79
+
79
80
 
80
81
  export var UserPickerFieldComponent = /*#__PURE__*/function (_React$Component) {
81
82
  _inherits(UserPickerFieldComponent, _React$Component);
@@ -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.
@@ -1 +1,7 @@
1
- export {};
1
+ // Third party integrations
2
+ export var TabType;
3
+
4
+ (function (TabType) {
5
+ TabType[TabType["default"] = 0] = "default";
6
+ TabType[TabType["Slack"] = 1] = "Slack";
7
+ })(TabType || (TabType = {}));
@@ -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
  var localesMessagesMap = {
3
6
  cs: cs,
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "name": "@atlaskit/share",
3
- "version": "3.0.0"
3
+ "version": "3.0.1"
4
4
  }
@@ -1,6 +1,6 @@
1
- import { TriggerProps } from '@atlaskit/popup';
2
1
  import React from 'react';
3
2
  import { WrappedComponentProps } from 'react-intl-next';
3
+ import { TriggerProps } from '@atlaskit/popup';
4
4
  export declare const AUTO_DISMISS_MS: number;
5
5
  export declare const MessageContainer: import("styled-components").StyledComponentClass<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, any, React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>>;
6
6
  declare type InputProps = {
@@ -4,5 +4,6 @@ export declare const FormWrapper: import("styled-components").StyledComponentCla
4
4
  export declare type IntegrationFormProps = {
5
5
  Content: React.ComponentType<IntegrationContentProps> | null;
6
6
  onIntegrationClose?: () => void;
7
+ changeTab?: (index: number) => void;
7
8
  };
8
- export declare const IntegrationForm: ({ Content, onIntegrationClose, }: IntegrationFormProps) => JSX.Element;
9
+ export declare const IntegrationForm: ({ Content, onIntegrationClose, changeTab, }: IntegrationFormProps) => JSX.Element;
@@ -1,7 +1,7 @@
1
1
  /// <reference types="react" />
2
2
  import type { LoadOptions } from '@atlaskit/user-picker';
3
- import { IntegrationFormProps } from '../IntegrationForm';
4
3
  import type { ShareData, ShareDialogWithTriggerProps, ShareDialogWithTriggerStates } from '../../types';
4
+ import { IntegrationFormProps } from '../IntegrationForm';
5
5
  export declare type LazyShareFormProps = Pick<ShareDialogWithTriggerProps, 'copyLink' | 'config' | 'isFetchingConfig' | 'loadUserOptions' | 'shareFormTitle' | 'shareFormHelperMessage' | 'bottomMessage' | 'submitButtonLabel' | 'product' | 'customFooter' | 'enableSmartUserPicker' | 'loggedInAccountId' | 'cloudId' | 'shareFieldsFooter' | 'onUserSelectionChange' | 'isPublicLink' | 'copyTooltipText' | 'shareIntegrations' | 'integrationMode' | 'onDialogClose'> & Pick<ShareDialogWithTriggerStates, 'showIntegrationForm' | 'selectedIntegration' | 'isSharing' | 'shareError' | 'defaultValue'> & Pick<IntegrationFormProps, 'Content'> & {
6
6
  onLinkCopy: () => void;
7
7
  onDismiss: (data: ShareData) => void;
@@ -1,5 +1,5 @@
1
- import { Appearance } from '@atlaskit/button/types';
2
1
  import React from 'react';
2
+ import { Appearance } from '@atlaskit/button/types';
3
3
  export declare type Props = {
4
4
  appearance?: Appearance;
5
5
  iconBefore?: React.ReactChild;
@@ -1,9 +1,8 @@
1
- import { AnalyticsEventPayload, WithAnalyticsEventsProps } from '@atlaskit/analytics-next';
2
1
  import React from 'react';
2
+ import { AnalyticsEventPayload, WithAnalyticsEventsProps } from '@atlaskit/analytics-next';
3
3
  import { ShortenRequest } from '../clients/AtlassianUrlShortenerClient';
4
4
  import { ConfigResponse } from '../clients/ShareServiceClient';
5
- import { ShareData, OriginTracing, OriginTracingFactory } from '../types';
6
- import type { ShareDialogContainerProps } from '../types';
5
+ import type { OriginTracing, OriginTracingFactory, ShareData, ShareDialogContainerProps } from '../types';
7
6
  export declare const defaultConfig: ConfigResponse;
8
7
  export declare type State = {
9
8
  config?: ConfigResponse;
@@ -1,8 +1,8 @@
1
1
  import React from 'react';
2
+ import { WrappedComponentProps } from 'react-intl-next';
2
3
  import { WithAnalyticsEventsProps } from '@atlaskit/analytics-next';
3
4
  import { TriggerProps } from '@atlaskit/popup';
4
- import { WrappedComponentProps } from 'react-intl-next';
5
- import { ShareData, Integration, ShareDialogWithTriggerProps, ShareDialogWithTriggerStates } from '../types';
5
+ import { Integration, ShareData, ShareDialogWithTriggerProps, ShareDialogWithTriggerStates } from '../types';
6
6
  export declare const defaultShareContentState: ShareData;
7
7
  declare type ShareDialogWithTriggerInternalProps = ShareDialogWithTriggerProps & WrappedComponentProps & WithAnalyticsEventsProps;
8
8
  export declare class ShareDialogWithTriggerInternal extends React.PureComponent<ShareDialogWithTriggerInternalProps, ShareDialogWithTriggerStates> {
@@ -1,11 +1,14 @@
1
1
  import React from 'react';
2
2
  import { WrappedComponentProps } from 'react-intl-next';
3
- import { FormChildrenArgs, ShareFormProps, ShareData } from '../types';
3
+ import { FormChildrenArgs, ShareData, ShareFormProps, TabType } from '../types';
4
4
  interface FormWrapperType {
5
5
  isMainShare?: boolean;
6
6
  }
7
7
  export declare const FormWrapper: import("styled-components").StyledComponentClass<React.ClassAttributes<HTMLDivElement> & React.HTMLAttributes<HTMLDivElement> & FormWrapperType, any, React.ClassAttributes<HTMLDivElement> & React.HTMLAttributes<HTMLDivElement> & FormWrapperType>;
8
8
  export declare const FormFooter: import("styled-components").StyledComponentClass<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, any, React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>>;
9
+ export declare type State = {
10
+ selectedTab: TabType;
11
+ };
9
12
  export declare type InternalFormProps = FormChildrenArgs<ShareData> & ShareFormProps & WrappedComponentProps;
10
13
  export declare const ShareForm: React.FC<ShareFormProps>;
11
14
  export {};