@atlaskit/share 2.0.0 → 3.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (76) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/dist/cjs/clients/ShareServiceClient.js +1 -7
  3. package/dist/cjs/components/CommentField.js +5 -4
  4. package/dist/cjs/components/CopyLinkButton.js +20 -11
  5. package/dist/cjs/components/ErrorBoundary.js +2 -0
  6. package/dist/cjs/components/IntegrationForm.js +7 -2
  7. package/dist/cjs/components/LazyShareForm/LazyShareForm.js +3 -3
  8. package/dist/cjs/components/LazyShareForm/lazy.js +2 -2
  9. package/dist/cjs/components/ShareButton.js +2 -2
  10. package/dist/cjs/components/ShareDialogContainer.js +9 -8
  11. package/dist/cjs/components/ShareDialogWithTrigger.js +12 -10
  12. package/dist/cjs/components/ShareForm.js +28 -9
  13. package/dist/cjs/components/ShareFormWrapper/ShareFormWrapper.js +2 -2
  14. package/dist/cjs/components/UserPickerField.js +8 -7
  15. package/dist/cjs/components/utils.js +2 -5
  16. package/dist/cjs/i18n.js +0 -10
  17. package/dist/cjs/types/ShareEntities.js +10 -1
  18. package/dist/cjs/types/index.js +9 -1
  19. package/dist/cjs/util/i18n-util.js +3 -0
  20. package/dist/cjs/version.json +1 -1
  21. package/dist/es2019/clients/ShareServiceClient.js +1 -7
  22. package/dist/es2019/components/CommentField.js +3 -2
  23. package/dist/es2019/components/CopyLinkButton.js +15 -7
  24. package/dist/es2019/components/ErrorBoundary.js +2 -0
  25. package/dist/es2019/components/IntegrationForm.js +4 -2
  26. package/dist/es2019/components/LazyShareForm/LazyShareForm.js +2 -2
  27. package/dist/es2019/components/LazyShareForm/lazy.js +2 -2
  28. package/dist/es2019/components/MessagesIntlProvider.js +1 -1
  29. package/dist/es2019/components/ShareButton.js +1 -1
  30. package/dist/es2019/components/ShareDialogContainer.js +6 -5
  31. package/dist/es2019/components/ShareDialogWithTrigger.js +11 -7
  32. package/dist/es2019/components/ShareForm.js +23 -6
  33. package/dist/es2019/components/ShareFormWrapper/ShareFormWrapper.js +1 -1
  34. package/dist/es2019/components/UserPickerField.js +5 -4
  35. package/dist/es2019/components/utils.js +1 -3
  36. package/dist/es2019/i18n.js +0 -10
  37. package/dist/es2019/types/ShareEntities.js +7 -1
  38. package/dist/es2019/types/index.js +2 -1
  39. package/dist/es2019/util/i18n-util.js +3 -0
  40. package/dist/es2019/version.json +1 -1
  41. package/dist/esm/clients/ShareServiceClient.js +1 -7
  42. package/dist/esm/components/CommentField.js +3 -2
  43. package/dist/esm/components/CopyLinkButton.js +15 -7
  44. package/dist/esm/components/ErrorBoundary.js +2 -0
  45. package/dist/esm/components/IntegrationForm.js +7 -2
  46. package/dist/esm/components/LazyShareForm/LazyShareForm.js +2 -2
  47. package/dist/esm/components/LazyShareForm/lazy.js +2 -2
  48. package/dist/esm/components/MessagesIntlProvider.js +1 -1
  49. package/dist/esm/components/ShareButton.js +1 -1
  50. package/dist/esm/components/ShareDialogContainer.js +6 -5
  51. package/dist/esm/components/ShareDialogWithTrigger.js +11 -7
  52. package/dist/esm/components/ShareForm.js +25 -5
  53. package/dist/esm/components/ShareFormWrapper/ShareFormWrapper.js +1 -1
  54. package/dist/esm/components/UserPickerField.js +5 -4
  55. package/dist/esm/components/utils.js +1 -3
  56. package/dist/esm/i18n.js +0 -10
  57. package/dist/esm/types/ShareEntities.js +7 -1
  58. package/dist/esm/types/index.js +2 -1
  59. package/dist/esm/util/i18n-util.js +3 -0
  60. package/dist/esm/version.json +1 -1
  61. package/dist/types/clients/ShareServiceClient.d.ts +2 -2
  62. package/dist/types/components/CopyLinkButton.d.ts +1 -1
  63. package/dist/types/components/IntegrationForm.d.ts +2 -1
  64. package/dist/types/components/LazyShareForm/LazyShareForm.d.ts +1 -1
  65. package/dist/types/components/ShareButton.d.ts +1 -1
  66. package/dist/types/components/ShareDialogContainer.d.ts +3 -4
  67. package/dist/types/components/ShareDialogWithTrigger.d.ts +2 -2
  68. package/dist/types/components/ShareForm.d.ts +4 -1
  69. package/dist/types/components/UserPickerField.d.ts +1 -1
  70. package/dist/types/i18n.d.ts +0 -10
  71. package/dist/types/types/ShareDialogContainer.d.ts +4 -9
  72. package/dist/types/types/ShareEntities.d.ts +5 -0
  73. package/dist/types/types/ShareForm.d.ts +2 -2
  74. package/dist/types/types/index.d.ts +1 -0
  75. package/docs/0-intro.tsx +4 -4
  76. package/package.json +24 -2
@@ -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
 
@@ -325,9 +328,10 @@ export var ShareDialogWithTriggerInternal = /*#__PURE__*/function (_React$PureCo
325
328
  button = /*#__PURE__*/React.createElement(ShareButton, _extends({
326
329
  appearance: triggerButtonAppearance,
327
330
  text: triggerButtonStyle !== 'icon-only' ? /*#__PURE__*/React.createElement(FormattedMessage, messages.shareTriggerButtonText) : null,
331
+ "aria-label": formatMessage(messages.shareTriggerButtonText),
328
332
  onClick: _this.onTriggerClick,
329
333
  iconBefore: triggerButtonStyle !== 'text-only' ? /*#__PURE__*/React.createElement(ShareButtonIcon, {
330
- label: formatMessage(messages.shareTriggerButtonIconLabel)
334
+ label: ""
331
335
  }) : undefined,
332
336
  isSelected: isDialogOpen,
333
337
  isDisabled: isDisabled
@@ -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.
package/dist/esm/i18n.js CHANGED
@@ -100,11 +100,6 @@ export var 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 var 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 +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": "2.0.0"
3
+ "version": "3.0.2"
4
4
  }
@@ -2,7 +2,7 @@ import { ServiceConfig } from '@atlaskit/util-service-support';
2
2
  import { Comment, Content, MetaData, User } from '../types';
3
3
  export interface ShareClient {
4
4
  share(content: Content, recipients: User[], metadata: MetaData, comment?: Comment): Promise<ShareResponse>;
5
- getConfig(cloudId: string, enableEmailPermissionCheck?: boolean): Promise<ConfigResponse>;
5
+ getConfig(cloudId: string): Promise<ConfigResponse>;
6
6
  }
7
7
  export declare type ShareRequest = (content: Content, recipients: User[], metadata: MetaData, comment?: Comment) => Promise<ShareResponse>;
8
8
  export declare type ShareResponse = {
@@ -17,7 +17,7 @@ export declare const DEFAULT_SHARE_SERVICE_URL = "/gateway/api";
17
17
  export declare class ShareServiceClient implements ShareClient {
18
18
  private serviceConfig;
19
19
  constructor(serviceConfig?: Partial<ServiceConfig>);
20
- getConfig(cloudId: string, enableEmailPermissionCheck?: boolean): Promise<ConfigResponse>;
20
+ getConfig(cloudId: string): Promise<ConfigResponse>;
21
21
  /**
22
22
  * To send a POST request to the share endpoint in Share service
23
23
  */
@@ -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;
@@ -53,7 +52,7 @@ export declare class ShareDialogContainerInternal extends React.Component<WithAn
53
52
  getFormShareLink: () => string;
54
53
  render(): JSX.Element;
55
54
  }
56
- export declare const ShareDialogContainer: React.ForwardRefExoticComponent<Pick<Pick<WithAnalyticsEventsProps & ShareDialogContainerProps, "onTriggerButtonClick" | "isAutoOpenDialog" | "shouldCloseOnEscapePress" | "dialogPlacement" | "loadUserOptions" | "onDialogOpen" | "onDialogClose" | "onUserSelectionChange" | "renderCustomTriggerButton" | "shareContentType" | "shareFormTitle" | "shareFormHelperMessage" | "showFlags" | "enableSmartUserPicker" | "loggedInAccountId" | "triggerButtonAppearance" | "triggerButtonIcon" | "triggerButtonStyle" | "triggerButtonTooltipPosition" | "triggerButtonTooltipText" | "cloudId" | "bottomMessage" | "product" | "customFooter" | "isCopyDisabled" | "isPublicLink" | "integrationMode" | "shareFieldsFooter" | "shareIntegrations" | "shareAri" | "tabIndex" | "copyTooltipText" | "dialogZIndex" | "shareClient" | "urlShortenerClient" | "shortLinkData" | "formatCopyLink" | "originTracingFactory" | "productId" | "shareLink" | "shareTitle" | "enableEmailPermissionCheck" | "useUrlShortener" | "shareeAction">, "onTriggerButtonClick" | "isAutoOpenDialog" | "shouldCloseOnEscapePress" | "dialogPlacement" | "loadUserOptions" | "onDialogOpen" | "onDialogClose" | "onUserSelectionChange" | "renderCustomTriggerButton" | "shareContentType" | "shareFormTitle" | "shareFormHelperMessage" | "showFlags" | "loggedInAccountId" | "triggerButtonAppearance" | "triggerButtonIcon" | "triggerButtonStyle" | "triggerButtonTooltipPosition" | "triggerButtonTooltipText" | "cloudId" | "bottomMessage" | "customFooter" | "isCopyDisabled" | "isPublicLink" | "integrationMode" | "shareFieldsFooter" | "shareIntegrations" | "shareAri" | "tabIndex" | "copyTooltipText" | "dialogZIndex" | "shareClient" | "urlShortenerClient" | "shortLinkData" | "formatCopyLink" | "originTracingFactory" | "productId" | "shareLink" | "shareTitle" | "enableEmailPermissionCheck" | "useUrlShortener"> & Partial<Pick<Pick<WithAnalyticsEventsProps & ShareDialogContainerProps, "onTriggerButtonClick" | "isAutoOpenDialog" | "shouldCloseOnEscapePress" | "dialogPlacement" | "loadUserOptions" | "onDialogOpen" | "onDialogClose" | "onUserSelectionChange" | "renderCustomTriggerButton" | "shareContentType" | "shareFormTitle" | "shareFormHelperMessage" | "showFlags" | "enableSmartUserPicker" | "loggedInAccountId" | "triggerButtonAppearance" | "triggerButtonIcon" | "triggerButtonStyle" | "triggerButtonTooltipPosition" | "triggerButtonTooltipText" | "cloudId" | "bottomMessage" | "product" | "customFooter" | "isCopyDisabled" | "isPublicLink" | "integrationMode" | "shareFieldsFooter" | "shareIntegrations" | "shareAri" | "tabIndex" | "copyTooltipText" | "dialogZIndex" | "shareClient" | "urlShortenerClient" | "shortLinkData" | "formatCopyLink" | "originTracingFactory" | "productId" | "shareLink" | "shareTitle" | "enableEmailPermissionCheck" | "useUrlShortener" | "shareeAction">, "enableSmartUserPicker" | "product" | "shareeAction">> & Partial<Pick<{
55
+ export declare const ShareDialogContainer: React.ForwardRefExoticComponent<Pick<Pick<WithAnalyticsEventsProps & ShareDialogContainerProps, "onTriggerButtonClick" | "isAutoOpenDialog" | "shouldCloseOnEscapePress" | "dialogPlacement" | "loadUserOptions" | "onDialogOpen" | "onDialogClose" | "onUserSelectionChange" | "renderCustomTriggerButton" | "shareContentType" | "shareFormTitle" | "shareFormHelperMessage" | "showFlags" | "enableSmartUserPicker" | "loggedInAccountId" | "triggerButtonAppearance" | "triggerButtonIcon" | "triggerButtonStyle" | "triggerButtonTooltipPosition" | "triggerButtonTooltipText" | "cloudId" | "bottomMessage" | "product" | "customFooter" | "isCopyDisabled" | "isPublicLink" | "integrationMode" | "shareFieldsFooter" | "shareIntegrations" | "shareAri" | "tabIndex" | "copyTooltipText" | "dialogZIndex" | "shareClient" | "urlShortenerClient" | "shortLinkData" | "formatCopyLink" | "originTracingFactory" | "productId" | "shareLink" | "shareTitle" | "useUrlShortener" | "shareeAction">, "onTriggerButtonClick" | "isAutoOpenDialog" | "shouldCloseOnEscapePress" | "dialogPlacement" | "loadUserOptions" | "onDialogOpen" | "onDialogClose" | "onUserSelectionChange" | "renderCustomTriggerButton" | "shareContentType" | "shareFormTitle" | "shareFormHelperMessage" | "showFlags" | "loggedInAccountId" | "triggerButtonAppearance" | "triggerButtonIcon" | "triggerButtonStyle" | "triggerButtonTooltipPosition" | "triggerButtonTooltipText" | "cloudId" | "bottomMessage" | "customFooter" | "isCopyDisabled" | "isPublicLink" | "integrationMode" | "shareFieldsFooter" | "shareIntegrations" | "shareAri" | "tabIndex" | "copyTooltipText" | "dialogZIndex" | "shareClient" | "urlShortenerClient" | "shortLinkData" | "formatCopyLink" | "originTracingFactory" | "productId" | "shareLink" | "shareTitle" | "useUrlShortener"> & Partial<Pick<Pick<WithAnalyticsEventsProps & ShareDialogContainerProps, "onTriggerButtonClick" | "isAutoOpenDialog" | "shouldCloseOnEscapePress" | "dialogPlacement" | "loadUserOptions" | "onDialogOpen" | "onDialogClose" | "onUserSelectionChange" | "renderCustomTriggerButton" | "shareContentType" | "shareFormTitle" | "shareFormHelperMessage" | "showFlags" | "enableSmartUserPicker" | "loggedInAccountId" | "triggerButtonAppearance" | "triggerButtonIcon" | "triggerButtonStyle" | "triggerButtonTooltipPosition" | "triggerButtonTooltipText" | "cloudId" | "bottomMessage" | "product" | "customFooter" | "isCopyDisabled" | "isPublicLink" | "integrationMode" | "shareFieldsFooter" | "shareIntegrations" | "shareAri" | "tabIndex" | "copyTooltipText" | "dialogZIndex" | "shareClient" | "urlShortenerClient" | "shortLinkData" | "formatCopyLink" | "originTracingFactory" | "productId" | "shareLink" | "shareTitle" | "useUrlShortener" | "shareeAction">, "enableSmartUserPicker" | "product" | "shareeAction">> & Partial<Pick<{
57
56
  enableSmartUserPicker: boolean;
58
57
  shareeAction: "view" | "edit";
59
58
  product: string;
@@ -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 {};
@@ -1,6 +1,6 @@
1
- import { LoadOptions, OptionData, Value } from '@atlaskit/user-picker';
2
1
  import React from 'react';
3
2
  import { WrappedComponentProps } from 'react-intl-next';
3
+ import { LoadOptions, OptionData, Value } from '@atlaskit/user-picker';
4
4
  import { ConfigResponse, ProductName } from '../types';
5
5
  export declare const REQUIRED = "REQUIRED";
6
6
  export declare type Props = {
@@ -99,11 +99,6 @@ export declare const messages: {
99
99
  defaultMessage: string;
100
100
  description: string;
101
101
  };
102
- copyLinkButtonIconLabel: {
103
- id: string;
104
- defaultMessage: string;
105
- description: string;
106
- };
107
102
  copyLinkButtonText: {
108
103
  id: string;
109
104
  defaultMessage: string;
@@ -114,11 +109,6 @@ export declare const messages: {
114
109
  defaultMessage: string;
115
110
  description: string;
116
111
  };
117
- copiedToClipboardIconLabel: {
118
- id: string;
119
- defaultMessage: string;
120
- description: string;
121
- };
122
112
  copiedToClipboardMessage: {
123
113
  id: string;
124
114
  defaultMessage: string;
@@ -1,15 +1,15 @@
1
1
  /// <reference types="react" />
2
- import type { IconProps } from '@atlaskit/icon';
3
2
  import type { Appearance } from '@atlaskit/button/types';
3
+ import type { IconProps } from '@atlaskit/icon';
4
4
  import type { LoadOptions, Value } from '@atlaskit/user-picker';
5
- import type { ShareClient } from '../clients/ShareServiceClient';
6
5
  import type { ShortenRequest, UrlShortenerClient } from '../clients/AtlassianUrlShortenerClient';
7
- import type { DialogPlacement, RenderCustomTriggerButton } from './ShareDialogWithTrigger';
6
+ import type { ShareClient } from '../clients/ShareServiceClient';
7
+ import type { Flag } from './Flag';
8
8
  import type { OriginTracing, OriginTracingFactory } from './OriginTracing';
9
9
  import type { ProductId, ProductName } from './Products';
10
10
  import type { ShareButtonStyle, TooltipPosition } from './ShareButton';
11
+ import type { DialogPlacement, RenderCustomTriggerButton } from './ShareDialogWithTrigger';
11
12
  import type { Integration, IntegrationMode } from './ShareEntities';
12
- import type { Flag } from './Flag';
13
13
  export declare type ShareDialogContainerProps = {
14
14
  onTriggerButtonClick?: () => void;
15
15
  onDialogOpen?: () => void;
@@ -93,11 +93,6 @@ export declare type ShareDialogContainerProps = {
93
93
  * - `cloudId`
94
94
  */
95
95
  enableSmartUserPicker?: boolean;
96
- /**
97
- * When true, the component will call the Share service to check whether the
98
- * site has sharing to emails enabled.
99
- */
100
- enableEmailPermissionCheck?: boolean;
101
96
  /**
102
97
  * The userId of the sharer. If not provided, smart user picker
103
98
  * defaults it to the value 'Context'
@@ -16,7 +16,12 @@ export declare type MetaData = {
16
16
  };
17
17
  export declare type IntegrationContentProps = {
18
18
  onClose: () => void;
19
+ changeTab?: (index: TabType) => void;
19
20
  };
21
+ export declare enum TabType {
22
+ default = 0,
23
+ Slack = 1
24
+ }
20
25
  export declare type Integration = {
21
26
  type: string;
22
27
  Icon: React.ComponentType;
@@ -1,8 +1,8 @@
1
1
  /// <reference types="react" />
2
- import type { ConfigResponse } from '../clients/ShareServiceClient';
3
- import type { ShareData, ShareError } from './ShareContentState';
4
2
  import type { LoadOptions } from '@atlaskit/user-picker';
3
+ import type { ConfigResponse } from '../clients/ShareServiceClient';
5
4
  import type { ProductName } from './Products';
5
+ import type { ShareData, ShareError } from './ShareContentState';
6
6
  import type { ShareDialogContainerProps } from './ShareDialogContainer';
7
7
  export declare type ShareFormProps = Pick<ShareDialogContainerProps, 'integrationMode' | 'shareIntegrations' | 'copyTooltipText' | 'isPublicLink' | 'onUserSelectionChange' | 'cloudId' | 'loggedInAccountId' | 'enableSmartUserPicker'> & {
8
8
  config?: ConfigResponse;
@@ -9,6 +9,7 @@ export type { ShareData, ShareData as DialogContentState, ShareContentState, Sha
9
9
  export type { DialogPlacement, DialogBoundariesElement, RenderCustomTriggerButton, ShareDialogWithTriggerProps, ShareDialogWithTriggerStates, } from './ShareDialogWithTrigger';
10
10
  export type { User, UserWithEmail, UserWithId } from './User';
11
11
  export type { Comment, Content, MetaData, Integration, IntegrationContentProps, } from './ShareEntities';
12
+ export { TabType } from './ShareEntities';
12
13
  export declare type KeysOfType<T, TProp> = {
13
14
  [P in keyof T]: T[P] extends TProp ? P : never;
14
15
  }[keyof T];
package/docs/0-intro.tsx CHANGED
@@ -1,14 +1,14 @@
1
+ import React from 'react';
2
+
1
3
  import {
4
+ AtlassianInternalWarning,
2
5
  code,
6
+ DevPreviewWarning,
3
7
  Example,
4
8
  md,
5
9
  Props,
6
- AtlassianInternalWarning,
7
- DevPreviewWarning,
8
10
  } from '@atlaskit/docs';
9
11
 
10
- import React from 'react';
11
-
12
12
  export default md`
13
13
  ${(
14
14
  <>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/share",
3
- "version": "2.0.0",
3
+ "version": "3.0.2",
4
4
  "description": "Fabric Share Element",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -42,11 +42,12 @@
42
42
  "@atlaskit/tabs": "^13.2.3",
43
43
  "@atlaskit/theme": "^12.0.0",
44
44
  "@atlaskit/tooltip": "^17.5.0",
45
- "@atlaskit/user-picker": "^8.0.0",
45
+ "@atlaskit/user-picker": "^8.1.0",
46
46
  "@atlaskit/util-service-support": "^6.0.0",
47
47
  "@babel/runtime": "^7.0.0",
48
48
  "fast-deep-equal": "^3.1.1",
49
49
  "memoize-one": "^6.0.0",
50
+ "react-device-detect": "^1.15.0",
50
51
  "react-intl-next": "npm:react-intl@^5.18.1",
51
52
  "react-loosely-lazy": "^0.5.0",
52
53
  "tiny-invariant": "^0.0.3"
@@ -81,5 +82,26 @@
81
82
  ".": "./src/index.ts",
82
83
  "./clients": "./src/clients/index.ts"
83
84
  },
85
+ "techstack": {
86
+ "@atlassian/frontend": {
87
+ "package-boundaries": [
88
+ "linting"
89
+ ],
90
+ "tree-shaking": [
91
+ "atlassian-conventions"
92
+ ],
93
+ "import-structure": [
94
+ "atlassian-conventions"
95
+ ],
96
+ "circular-dependencies": [
97
+ "file-and-folder-level"
98
+ ]
99
+ },
100
+ "@repo/internal": {
101
+ "ui-components": "lite-mode",
102
+ "analytics": "analytics-next",
103
+ "deprecation": "no-deprecated-imports"
104
+ }
105
+ },
84
106
  "prettier": "@atlassian/atlassian-frontend-prettier-config-1.0.1"
85
107
  }