@atlaskit/share 3.7.1 → 3.7.3

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 (131) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/cjs/clients/AtlassianUrlShortenerClient.js +0 -22
  3. package/dist/cjs/clients/ShareServiceClient.js +1 -12
  4. package/dist/cjs/clients/index.js +0 -1
  5. package/dist/cjs/components/CommentField.js +0 -9
  6. package/dist/cjs/components/CopyLinkButton.js +8 -48
  7. package/dist/cjs/components/ErrorBoundary.js +0 -26
  8. package/dist/cjs/components/IntegrationButton.js +3 -15
  9. package/dist/cjs/components/IntegrationForm.js +8 -17
  10. package/dist/cjs/components/LazyShareForm/LazyShareForm.js +35 -51
  11. package/dist/cjs/components/LazyShareForm/index.js +0 -2
  12. package/dist/cjs/components/LazyShareForm/lazy.js +4 -18
  13. package/dist/cjs/components/MessagesIntlProvider.js +1 -14
  14. package/dist/cjs/components/ShareButton.js +1 -9
  15. package/dist/cjs/components/ShareDialogContainer.js +55 -124
  16. package/dist/cjs/components/ShareDialogWithTrigger.js +85 -159
  17. package/dist/cjs/components/ShareForm.js +41 -100
  18. package/dist/cjs/components/ShareFormWrapper/ShareFormWrapper.js +5 -11
  19. package/dist/cjs/components/ShareFormWrapper/index.js +0 -2
  20. package/dist/cjs/components/ShareFormWrapper/styled.js +2 -9
  21. package/dist/cjs/components/ShareHeader.js +0 -14
  22. package/dist/cjs/components/SlackIcon.js +0 -4
  23. package/dist/cjs/components/SplitButton.js +18 -43
  24. package/dist/cjs/components/UserPickerField.js +21 -71
  25. package/dist/cjs/components/analytics/analytics.js +6 -39
  26. package/dist/cjs/components/analytics/ufoExperienceHelper.js +0 -4
  27. package/dist/cjs/components/analytics/ufoExperiences.js +0 -2
  28. package/dist/cjs/components/colorSlackIcon.js +0 -4
  29. package/dist/cjs/components/localStorageUtils.js +0 -11
  30. package/dist/cjs/components/monochromeSlackIcon.js +2 -4
  31. package/dist/cjs/components/styles.js +2 -16
  32. package/dist/cjs/components/utils.js +4 -19
  33. package/dist/cjs/i18n/cs.js +0 -1
  34. package/dist/cjs/i18n/da.js +0 -1
  35. package/dist/cjs/i18n/de.js +0 -1
  36. package/dist/cjs/i18n/en.js +0 -1
  37. package/dist/cjs/i18n/en_GB.js +0 -1
  38. package/dist/cjs/i18n/en_ZZ.js +0 -1
  39. package/dist/cjs/i18n/es.js +0 -1
  40. package/dist/cjs/i18n/et.js +0 -1
  41. package/dist/cjs/i18n/fi.js +0 -1
  42. package/dist/cjs/i18n/fr.js +0 -1
  43. package/dist/cjs/i18n/hu.js +0 -1
  44. package/dist/cjs/i18n/index.js +0 -31
  45. package/dist/cjs/i18n/is.js +0 -1
  46. package/dist/cjs/i18n/it.js +0 -1
  47. package/dist/cjs/i18n/ja.js +0 -1
  48. package/dist/cjs/i18n/ko.js +0 -1
  49. package/dist/cjs/i18n/languages.js +0 -1
  50. package/dist/cjs/i18n/nb.js +0 -1
  51. package/dist/cjs/i18n/nl.js +0 -1
  52. package/dist/cjs/i18n/pl.js +0 -1
  53. package/dist/cjs/i18n/pt_BR.js +0 -1
  54. package/dist/cjs/i18n/pt_PT.js +0 -1
  55. package/dist/cjs/i18n/ro.js +0 -1
  56. package/dist/cjs/i18n/ru.js +0 -1
  57. package/dist/cjs/i18n/sk.js +0 -1
  58. package/dist/cjs/i18n/sv.js +0 -1
  59. package/dist/cjs/i18n/th.js +0 -1
  60. package/dist/cjs/i18n/tr.js +0 -1
  61. package/dist/cjs/i18n/uk.js +0 -1
  62. package/dist/cjs/i18n/vi.js +0 -1
  63. package/dist/cjs/i18n/zh.js +0 -1
  64. package/dist/cjs/i18n/zh_TW.js +0 -1
  65. package/dist/cjs/i18n.js +2 -3
  66. package/dist/cjs/index.js +0 -3
  67. package/dist/cjs/types/ShareEntities.js +0 -1
  68. package/dist/cjs/types/index.js +0 -2
  69. package/dist/cjs/util/i18n-util.js +2 -8
  70. package/dist/cjs/version.json +1 -1
  71. package/dist/es2019/clients/AtlassianUrlShortenerClient.js +0 -6
  72. package/dist/es2019/clients/ShareServiceClient.js +1 -4
  73. package/dist/es2019/components/CopyLinkButton.js +2 -13
  74. package/dist/es2019/components/ErrorBoundary.js +0 -10
  75. package/dist/es2019/components/IntegrationButton.js +0 -2
  76. package/dist/es2019/components/LazyShareForm/LazyShareForm.js +2 -4
  77. package/dist/es2019/components/LazyShareForm/lazy.js +3 -5
  78. package/dist/es2019/components/MessagesIntlProvider.js +2 -3
  79. package/dist/es2019/components/ShareDialogContainer.js +19 -59
  80. package/dist/es2019/components/ShareDialogWithTrigger.js +28 -65
  81. package/dist/es2019/components/ShareForm.js +4 -24
  82. package/dist/es2019/components/ShareFormWrapper/ShareFormWrapper.js +0 -2
  83. package/dist/es2019/components/ShareFormWrapper/styled.js +2 -1
  84. package/dist/es2019/components/SlackIcon.js +0 -2
  85. package/dist/es2019/components/SplitButton.js +2 -5
  86. package/dist/es2019/components/UserPickerField.js +3 -24
  87. package/dist/es2019/components/analytics/analytics.js +9 -13
  88. package/dist/es2019/components/analytics/ufoExperienceHelper.js +0 -2
  89. package/dist/es2019/components/colorSlackIcon.js +0 -2
  90. package/dist/es2019/components/localStorageUtils.js +0 -3
  91. package/dist/es2019/components/monochromeSlackIcon.js +2 -2
  92. package/dist/es2019/components/styles.js +3 -2
  93. package/dist/es2019/components/utils.js +7 -8
  94. package/dist/es2019/i18n.js +2 -1
  95. package/dist/es2019/index.js +2 -1
  96. package/dist/es2019/types/ShareEntities.js +1 -1
  97. package/dist/es2019/util/i18n-util.js +1 -5
  98. package/dist/es2019/version.json +1 -1
  99. package/dist/esm/clients/AtlassianUrlShortenerClient.js +0 -16
  100. package/dist/esm/clients/ShareServiceClient.js +1 -7
  101. package/dist/esm/components/CopyLinkButton.js +8 -31
  102. package/dist/esm/components/ErrorBoundary.js +0 -18
  103. package/dist/esm/components/IntegrationButton.js +3 -8
  104. package/dist/esm/components/IntegrationForm.js +8 -10
  105. package/dist/esm/components/LazyShareForm/LazyShareForm.js +35 -37
  106. package/dist/esm/components/LazyShareForm/lazy.js +5 -7
  107. package/dist/esm/components/MessagesIntlProvider.js +1 -6
  108. package/dist/esm/components/ShareButton.js +1 -2
  109. package/dist/esm/components/ShareDialogContainer.js +55 -109
  110. package/dist/esm/components/ShareDialogWithTrigger.js +89 -155
  111. package/dist/esm/components/ShareForm.js +41 -74
  112. package/dist/esm/components/ShareFormWrapper/ShareFormWrapper.js +5 -7
  113. package/dist/esm/components/ShareFormWrapper/styled.js +2 -1
  114. package/dist/esm/components/ShareHeader.js +0 -2
  115. package/dist/esm/components/SlackIcon.js +0 -2
  116. package/dist/esm/components/SplitButton.js +18 -24
  117. package/dist/esm/components/UserPickerField.js +21 -55
  118. package/dist/esm/components/analytics/analytics.js +6 -15
  119. package/dist/esm/components/analytics/ufoExperienceHelper.js +0 -2
  120. package/dist/esm/components/colorSlackIcon.js +0 -2
  121. package/dist/esm/components/localStorageUtils.js +0 -3
  122. package/dist/esm/components/monochromeSlackIcon.js +2 -2
  123. package/dist/esm/components/styles.js +2 -7
  124. package/dist/esm/components/utils.js +7 -8
  125. package/dist/esm/i18n.js +2 -1
  126. package/dist/esm/index.js +2 -1
  127. package/dist/esm/types/ShareEntities.js +1 -1
  128. package/dist/esm/util/i18n-util.js +1 -5
  129. package/dist/esm/version.json +1 -1
  130. package/dist/types/types/ShareDialogContainer.d.ts +3 -1
  131. package/package.json +5 -3
@@ -10,19 +10,15 @@ import { MAX_PICKER_HEIGHT } from './styles';
10
10
  import { allowEmails, getMenuPortalTargetCurrentHTML } from './utils';
11
11
  export const REQUIRED = 'REQUIRED';
12
12
  const DEBOUNCE_MS = 150;
13
-
14
13
  const validate = value => {
15
14
  return value && value instanceof Array && value.length > 0 ? undefined : REQUIRED;
16
15
  };
17
-
18
16
  const getNoOptionsMessageDescriptor = (emailValidity, isPublicLink, allowEmail) => {
19
17
  if (isPublicLink || !allowEmail) {
20
18
  return messages.userPickerExistingUserOnlyNoOptionsMessage;
21
19
  }
22
-
23
20
  return messages.userPickerGenericNoOptionsMessage;
24
21
  };
25
-
26
22
  const getNoOptionsMessage = (isPublicLink, allowEmail) => ({
27
23
  inputValue
28
24
  }) => inputValue && inputValue.trim().length > 0 ? /*#__PURE__*/React.createElement(FormattedMessage, _extends({}, getNoOptionsMessageDescriptor(isValidEmail(inputValue), isPublicLink, allowEmail), {
@@ -30,7 +26,6 @@ const getNoOptionsMessage = (isPublicLink, allowEmail) => ({
30
26
  inputValue
31
27
  }
32
28
  })) : null;
33
-
34
29
  const getPlaceHolderMessageDescriptor = (product = 'confluence', allowEmail, isBrowseUsersDisabled) => {
35
30
  if (!allowEmail) {
36
31
  const placeholderMessage = {
@@ -39,18 +34,15 @@ const getPlaceHolderMessageDescriptor = (product = 'confluence', allowEmail, isB
39
34
  };
40
35
  return placeholderMessage[product];
41
36
  }
42
-
43
37
  if (isBrowseUsersDisabled) {
44
38
  return messages.userPickerGenericEmailOnlyPlaceholder;
45
39
  }
46
-
47
40
  const placeholderMessage = {
48
41
  jira: messages.userPickerGenericPlaceholderJira,
49
42
  confluence: messages.userPickerGenericPlaceholder
50
43
  };
51
44
  return placeholderMessage[product];
52
45
  };
53
-
54
46
  const requiredMessagesWithEmail = {
55
47
  confluence: messages.userPickerRequiredMessage,
56
48
  jira: messages.userPickerRequiredMessageJira
@@ -59,64 +51,52 @@ const requiredMessagesWithoutEmail = {
59
51
  confluence: messages.userPickerRequiredExistingUserOnlyMessage,
60
52
  jira: messages.userPickerRequiredExistingUserOnlyMessageJira
61
53
  };
62
-
63
54
  const getRequiredMessage = (product, allowEmail, isBrowseUsersDisabled) => {
64
55
  if (isBrowseUsersDisabled) {
65
56
  return messages.userPickerRequiredMessageEmailOnly;
66
57
  }
67
-
68
58
  const emailMessages = allowEmail ? requiredMessagesWithEmail : requiredMessagesWithoutEmail;
69
59
  return emailMessages[product];
70
- }; // eslint-disable-next-line @repo/internal/react/no-class-components
71
-
60
+ };
72
61
 
62
+ // eslint-disable-next-line @repo/internal/react/no-class-components
73
63
  export class UserPickerFieldComponent extends React.Component {
74
64
  constructor(...args) {
75
65
  super(...args);
76
-
77
66
  _defineProperty(this, "loadOptions", search => {
78
67
  const {
79
68
  loadOptions
80
69
  } = this.props;
81
-
82
70
  if (loadOptions && search && search.length > 0) {
83
71
  return loadOptions(search);
84
72
  } else {
85
73
  return [];
86
74
  }
87
75
  });
88
-
89
76
  _defineProperty(this, "getInviteWarningMessage", () => {
90
77
  const {
91
78
  product,
92
79
  isPublicLink,
93
80
  helperMessage
94
81
  } = this.props;
95
-
96
82
  if (isPublicLink) {
97
83
  return null;
98
84
  }
99
-
100
- if (helperMessage) {
85
+ if (helperMessage !== undefined) {
101
86
  return helperMessage;
102
87
  }
103
-
104
88
  return product === 'jira' ? /*#__PURE__*/React.createElement(FormattedMessage, messages.infoMessageDefaultJira) : /*#__PURE__*/React.createElement(FormattedMessage, messages.infoMessageDefaultConfluence);
105
89
  });
106
-
107
90
  _defineProperty(this, "handleUserPickerTransform", (event, current) => {
108
91
  const {
109
92
  onChange
110
93
  } = this.props;
111
-
112
94
  if (onChange) {
113
95
  onChange(event);
114
96
  }
115
-
116
97
  return event;
117
98
  });
118
99
  }
119
-
120
100
  render() {
121
101
  const {
122
102
  defaultValue,
@@ -178,6 +158,5 @@ export class UserPickerFieldComponent extends React.Component {
178
158
  })), inviteWarningMessage && /*#__PURE__*/React.createElement(HelperMessage, null, inviteWarningMessage), !valid && error === REQUIRED && /*#__PURE__*/React.createElement(ErrorMessage, null, /*#__PURE__*/React.createElement(FormattedMessage, requiredMessage)));
179
159
  });
180
160
  }
181
-
182
161
  }
183
162
  export const UserPickerField = injectIntl(UserPickerFieldComponent);
@@ -1,11 +1,9 @@
1
1
  import { isEmail, isTeam, isUser } from '@atlaskit/smart-user-picker';
2
-
3
2
  const buildAttributes = (attributes = {}) => ({
4
3
  packageName: "@atlaskit/share",
5
- packageVersion: "3.7.1",
4
+ packageVersion: "3.7.3",
6
5
  ...attributes
7
6
  });
8
-
9
7
  const createEvent = (eventType, source, action, actionSubject, actionSubjectId, attributes = {}) => ({
10
8
  eventType,
11
9
  action,
@@ -14,13 +12,11 @@ const createEvent = (eventType, source, action, actionSubject, actionSubjectId,
14
12
  source,
15
13
  attributes: buildAttributes(attributes)
16
14
  });
17
-
18
15
  const createScreenEvent = (name, attributes = {}) => ({
19
16
  eventType: 'screen',
20
17
  name,
21
18
  attributes: buildAttributes(attributes)
22
19
  });
23
-
24
20
  export const CHANNEL_ID = 'fabric-elements';
25
21
  export const ANALYTICS_SOURCE = 'shareModal';
26
22
  export const INTEGRATION_MODAL_SOURCE = 'integrationShareDialog';
@@ -33,10 +29,12 @@ export const shareSplitButtonEvent = () => createEvent('ui', INTEGRATION_MODAL_S
33
29
  export const shareIntegrationButtonEvent = (type = '') => createEvent('ui', INTEGRATION_MODAL_SOURCE, 'clicked', 'button', 'shareToIntegration', {
34
30
  integrationType: type.toLowerCase()
35
31
  });
36
- export const errorEncountered = (actionSubjectId, attributes = {}) => createEvent('operational', ANALYTICS_SOURCE, 'encountered', 'error', actionSubjectId, { ...attributes,
32
+ export const errorEncountered = (actionSubjectId, attributes = {}) => createEvent('operational', ANALYTICS_SOURCE, 'encountered', 'error', actionSubjectId, {
33
+ ...attributes,
37
34
  source: ANALYTICS_SOURCE
38
- }); // = share dialog invoked. Not to be confused with "share submitted"
35
+ });
39
36
 
37
+ // = share dialog invoked. Not to be confused with "share submitted"
40
38
  export const shareTriggerButtonClicked = () => createEvent('ui', ANALYTICS_SOURCE, 'clicked', 'button', 'share');
41
39
  export const shareTabClicked = (subjectId, shareContentType, isJwmShareToSlackFFEnabled) => createEvent('ui', ANALYTICS_SOURCE, 'clicked', 'tab', subjectId || 'shareTab', isJwmShareToSlackFFEnabled && {
42
40
  shareContentType
@@ -68,7 +66,8 @@ export const formShareSubmitted = (start, data, shareContentType, shareOrigin, i
68
66
  const teams = extractIdsByType(data, isTeam);
69
67
  const teamUserCounts = extractMemberCountsFromTeams(data, isTeam);
70
68
  const emails = extractIdsByType(data, isEmail);
71
- return createEvent('ui', ANALYTICS_SOURCE, 'clicked', 'button', 'submitShare', { ...getOriginTracingAttributes(shareOrigin),
69
+ return createEvent('ui', ANALYTICS_SOURCE, 'clicked', 'button', 'submitShare', {
70
+ ...getOriginTracingAttributes(shareOrigin),
72
71
  contentType: shareContentType,
73
72
  duration: duration(start),
74
73
  emailCount: emails.length,
@@ -82,15 +81,12 @@ export const formShareSubmitted = (start, data, shareContentType, shareOrigin, i
82
81
  isPublicLink
83
82
  });
84
83
  };
85
-
86
84
  const duration = start => Date.now() - start;
87
-
88
85
  const getOriginTracingAttributes = origin => origin ? origin.toAnalyticsAttributes({
89
86
  hasGeneratedId: true
90
87
  }) : {};
91
-
92
88
  const extractIdsByType = (data, checker) => data.users.filter(checker).map(option => option.id);
93
-
94
- const extractMemberCountsFromTeams = (data, checker) => // teams with zero memberships cannot exist in share, so we use that
89
+ const extractMemberCountsFromTeams = (data, checker) =>
90
+ // teams with zero memberships cannot exist in share, so we use that
95
91
  // as the default value for undefined team member counts
96
92
  data.users.filter(checker).map(option => option.memberCount || 0);
@@ -1,7 +1,6 @@
1
1
  const ignoredErrorStatusCode = [401, 403, 429];
2
2
  export const isValidFailedExperience = (experience, error) => {
3
3
  const errorStatusCode = error.code || error.status || error.statusCode;
4
-
5
4
  if (ignoredErrorStatusCode.includes(parseInt(errorStatusCode))) {
6
5
  experience.abort({
7
6
  metadata: {
@@ -10,7 +9,6 @@ export const isValidFailedExperience = (experience, error) => {
10
9
  });
11
10
  return;
12
11
  }
13
-
14
12
  experience.failure({
15
13
  metadata: {
16
14
  error
@@ -1,5 +1,4 @@
1
1
  import React from 'react';
2
-
3
2
  const SlackIcon = () => {
4
3
  return /*#__PURE__*/React.createElement("svg", {
5
4
  width: "16",
@@ -53,5 +52,4 @@ const SlackIcon = () => {
53
52
  className: "prefix__st3"
54
53
  })))));
55
54
  };
56
-
57
55
  export default SlackIcon;
@@ -5,10 +5,8 @@ const getLocalStorageKey = key => {
5
5
  // eslint-disable-next-line no-console
6
6
  console.error(e);
7
7
  }
8
-
9
8
  return null;
10
9
  };
11
-
12
10
  const updateLocalStorageKey = (key, value) => {
13
11
  try {
14
12
  localStorage.setItem(key, value);
@@ -17,7 +15,6 @@ const updateLocalStorageKey = (key, value) => {
17
15
  console.error(e);
18
16
  }
19
17
  };
20
-
21
18
  export const getDefaultSlackWorkSpace = product => {
22
19
  const key = `defaultSlackWorkspace-${product}`;
23
20
  return getLocalStorageKey(key);
@@ -1,7 +1,8 @@
1
1
  /* eslint-disable @atlaskit/design-system/ensure-design-token-usage */
2
+
2
3
  // TODO : https://product-fabric.atlassian.net/browse/DSP-3518
3
- import React from 'react';
4
4
 
5
+ import React from 'react';
5
6
  const SlackIcon = () => {
6
7
  return /*#__PURE__*/React.createElement("svg", {
7
8
  width: "100",
@@ -35,5 +36,4 @@ const SlackIcon = () => {
35
36
  fill: "#253858"
36
37
  }));
37
38
  };
38
-
39
39
  export default SlackIcon;
@@ -11,13 +11,14 @@ const StyledButton = /*#__PURE__*/React.forwardRef((props, ref) => /*#__PURE__*/
11
11
  ...rest
12
12
  } = currentTheme(themeProps);
13
13
  return {
14
- buttonStyles: { ...buttonStyles,
14
+ buttonStyles: {
15
+ ...buttonStyles,
15
16
  padding: 0,
16
17
  '& > span > span:first-of-type': {
17
18
  margin: '0' // This is a workaround for an issue in AtlasKit (https://ecosystem.atlassian.net/browse/AK-3976)
18
-
19
19
  }
20
20
  },
21
+
21
22
  ...rest
22
23
  };
23
24
  }
@@ -1,4 +1,6 @@
1
- import { layers } from '@atlaskit/theme/constants'; // AFP-2532 TODO: Fix automatic suppressions below
1
+ import { layers } from '@atlaskit/theme/constants';
2
+
3
+ // AFP-2532 TODO: Fix automatic suppressions below
2
4
  // eslint-disable-next-line @atlassian/tangerine/import/entry-points
3
5
 
4
6
  /**
@@ -7,6 +9,7 @@ import { layers } from '@atlaskit/theme/constants'; // AFP-2532 TODO: Fix automa
7
9
  * a different value, we need check it, and in case of Select Portal z-index, we need to
8
10
  * top it, so it's visible in the popup.
9
11
  */
12
+
10
13
  export const zIndexAddition = 10;
11
14
  export const generateSelectZIndex = dialogZIndex => {
12
15
  // If user provided non-number value for zIndex, ignore and return undefined,
@@ -14,24 +17,21 @@ export const generateSelectZIndex = dialogZIndex => {
14
17
  if (typeof dialogZIndex !== 'number' || !dialogZIndex) {
15
18
  return layers.modal() + zIndexAddition;
16
19
  }
17
-
18
20
  return dialogZIndex + zIndexAddition;
19
21
  };
22
+
20
23
  /**
21
24
  * Helper to get around TS error of property `current` not being
22
25
  * part of React's `ref` object.
23
26
  */
24
-
25
27
  export const getMenuPortalTargetCurrentHTML = ref => {
26
28
  if (!ref) {
27
29
  return null;
28
30
  }
29
-
30
31
  if (!Object.prototype.hasOwnProperty.call(ref, 'current')) {
31
32
  return null;
32
- } // @ts-ignore ts(2339) - ref not having property current
33
-
34
-
33
+ }
34
+ // @ts-ignore ts(2339) - ref not having property current
35
35
  return ref.current;
36
36
  };
37
37
  export const optionDataToUsers = optionDataArray => optionDataArray.map(optionData => {
@@ -42,7 +42,6 @@ export const optionDataToUsers = optionDataArray => optionDataArray.map(optionDa
42
42
  email: optionData.id
43
43
  };
44
44
  return user;
45
-
46
45
  default:
47
46
  return {
48
47
  type: optionData.type || 'user',
@@ -162,7 +162,8 @@ export const messages = defineMessages({
162
162
  },
163
163
  shareSuccessMessage: {
164
164
  id: 'fabric.elements.share.success.message',
165
- defaultMessage: '{object, select,' + 'blogpost {Blog post shared}' + 'board {Board shared}' + 'calendar {Calendar shared}' + 'draft {Draft shared}' + // this is a placeholder for Invite to edit in Confluence
165
+ defaultMessage: '{object, select,' + 'blogpost {Blog post shared}' + 'board {Board shared}' + 'calendar {Calendar shared}' + 'draft {Draft shared}' +
166
+ // this is a placeholder for Invite to edit in Confluence
166
167
  'filter {Filter shared}' + 'issue {Issue shared}' + 'summary {Summary shared}' + 'list {List shared}' + 'timeline {Timeline shared}' + 'form {Form shared}' + 'media {Media shared}' + 'page {Page shared}' + 'project {Project shared}' + 'pullrequest {Pull Request shared}' + 'question {Question shared}' + 'report {Report shared}' + 'repository {Repository shared}' + 'request {Request shared}' + 'roadmap {Roadmap shared}' + 'site {Site shared}' + 'space {Space shared}' + 'other {Link Shared}' + '}',
167
168
  description: 'Default text for share success message displayed in a flag'
168
169
  },
@@ -1,4 +1,5 @@
1
1
  export { ShareDialogContainer } from './components/ShareDialogContainer';
2
2
  export { CopyLinkButton } from './components/CopyLinkButton';
3
- export { // Constants
3
+ export {
4
+ // Constants
4
5
  ADMIN_NOTIFIED, OBJECT_SHARED } from './types';
@@ -1,6 +1,6 @@
1
1
  // Third party integrations
2
- export let TabType;
3
2
 
3
+ export let TabType;
4
4
  (function (TabType) {
5
5
  TabType[TabType["default"] = 0] = "default";
6
6
  TabType[TabType["Slack"] = 1] = "Slack";
@@ -1,5 +1,4 @@
1
1
  // Cannot import from `../i18n` because there is `../i18n.tsx` file there.
2
-
3
2
  /* eslint-disable @atlassian/tangerine/import/no-dangling-index */
4
3
  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';
5
4
  const localesMessagesMap = {
@@ -31,6 +30,7 @@ const localesMessagesMap = {
31
30
  sv,
32
31
  zh
33
32
  };
33
+
34
34
  /**
35
35
  * Tries to get the most specific messages bundle for a given locale.
36
36
  *
@@ -41,18 +41,14 @@ const localesMessagesMap = {
41
41
  *
42
42
  * @param locale string specifying the locale like 'en_GB', or 'fr'.
43
43
  */
44
-
45
44
  export const getMessagesForLocale = locale => {
46
45
  let messages = localesMessagesMap[locale];
47
-
48
46
  if (!messages) {
49
47
  const parentLocale = locale.split(/[-_]/)[0];
50
48
  messages = localesMessagesMap[parentLocale];
51
49
  }
52
-
53
50
  if (!messages) {
54
51
  messages = en;
55
52
  }
56
-
57
53
  return messages;
58
54
  };
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "name": "@atlaskit/share",
3
- "version": "3.7.1"
3
+ "version": "3.7.3"
4
4
  }
@@ -6,7 +6,6 @@ export var AtlassianUrlShortenerClient = /*#__PURE__*/function () {
6
6
  function AtlassianUrlShortenerClient() {
7
7
  _classCallCheck(this, AtlassianUrlShortenerClient);
8
8
  }
9
-
10
9
  _createClass(AtlassianUrlShortenerClient, [{
11
10
  key: "shorten",
12
11
  value: function () {
@@ -25,44 +24,32 @@ export var AtlassianUrlShortenerClient = /*#__PURE__*/function () {
25
24
  },
26
25
  body: JSON.stringify(data)
27
26
  });
28
-
29
27
  case 3:
30
28
  response = _context.sent;
31
-
32
29
  if (response.ok) {
33
30
  _context.next = 6;
34
31
  break;
35
32
  }
36
-
37
33
  throw new Error("status=\"".concat(response.status, "\""));
38
-
39
34
  case 6:
40
35
  _context.next = 8;
41
36
  return response.json();
42
-
43
37
  case 8:
44
38
  result = _context.sent;
45
-
46
39
  if (result.shortUrl) {
47
40
  _context.next = 11;
48
41
  break;
49
42
  }
50
-
51
43
  throw new Error('Breach of contract!');
52
-
53
44
  case 11:
54
45
  return _context.abrupt("return", result);
55
-
56
46
  case 14:
57
47
  _context.prev = 14;
58
48
  _context.t0 = _context["catch"](0);
59
-
60
49
  if (_context.t0 instanceof Error) {
61
50
  _context.t0.message = "While shortening URL: ".concat(_context.t0.message, "!");
62
51
  }
63
-
64
52
  throw _context.t0;
65
-
66
53
  case 18:
67
54
  case "end":
68
55
  return _context.stop();
@@ -70,14 +57,11 @@ export var AtlassianUrlShortenerClient = /*#__PURE__*/function () {
70
57
  }
71
58
  }, _callee, null, [[0, 14]]);
72
59
  }));
73
-
74
60
  function shorten(_x) {
75
61
  return _shorten.apply(this, arguments);
76
62
  }
77
-
78
63
  return shorten;
79
64
  }()
80
65
  }]);
81
-
82
66
  return AtlassianUrlShortenerClient;
83
67
  }();
@@ -1,11 +1,8 @@
1
1
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
2
  import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
3
3
  import _createClass from "@babel/runtime/helpers/createClass";
4
-
5
4
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
6
-
7
5
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
8
-
9
6
  import { utils } from '@atlaskit/util-service-support';
10
7
  export var DEFAULT_SHARE_PATH = 'share';
11
8
  export var SHARE_CONFIG_PATH = 'share/configuration';
@@ -13,12 +10,10 @@ export var DEFAULT_SHARE_SERVICE_URL = '/gateway/api';
13
10
  export var ShareServiceClient = /*#__PURE__*/function () {
14
11
  function ShareServiceClient(serviceConfig) {
15
12
  _classCallCheck(this, ShareServiceClient);
16
-
17
13
  this.serviceConfig = _objectSpread({
18
14
  url: DEFAULT_SHARE_SERVICE_URL
19
15
  }, serviceConfig || {});
20
16
  }
21
-
22
17
  _createClass(ShareServiceClient, [{
23
18
  key: "getConfig",
24
19
  value: function getConfig(cloudId) {
@@ -33,10 +28,10 @@ export var ShareServiceClient = /*#__PURE__*/function () {
33
28
  };
34
29
  return utils.requestService(this.serviceConfig, options);
35
30
  }
31
+
36
32
  /**
37
33
  * To send a POST request to the share endpoint in Share service
38
34
  */
39
-
40
35
  }, {
41
36
  key: "share",
42
37
  value: function share(content, recipients, metadata, comment) {
@@ -58,6 +53,5 @@ export var ShareServiceClient = /*#__PURE__*/function () {
58
53
  return utils.requestService(this.serviceConfig, options);
59
54
  }
60
55
  }]);
61
-
62
56
  return ShareServiceClient;
63
57
  }();
@@ -7,13 +7,9 @@ import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstruct
7
7
  import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
8
8
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
9
9
  import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
10
-
11
10
  var _templateObject, _templateObject2;
12
-
13
11
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
14
-
15
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; } }
16
-
17
13
  /** @jsx jsx */
18
14
  import React from 'react';
19
15
  import { css, jsx } from '@emotion/react';
@@ -31,7 +27,8 @@ export var AUTO_DISMISS_MS = AUTO_DISMISS_SECONDS * 1000;
31
27
  export var messageContainerStyle = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n align-items: center;\n margin: -8px -16px;\n"])));
32
28
  var messageTextStyle = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n text-indent: 6px;\n"])));
33
29
  var isSafari = navigator.userAgent.indexOf('Safari');
34
- export var HiddenInput = /*#__PURE__*/React.forwardRef( // we need a hidden input to reliably copy to clipboard across all browsers.
30
+ export var HiddenInput = /*#__PURE__*/React.forwardRef(
31
+ // we need a hidden input to reliably copy to clipboard across all browsers.
35
32
  function (props, ref) {
36
33
  return jsx("input", {
37
34
  style: {
@@ -48,47 +45,34 @@ function (props, ref) {
48
45
  // eslint-disable-next-line @repo/internal/react/no-class-components
49
46
  export var CopyLinkButton = /*#__PURE__*/function (_React$Component) {
50
47
  _inherits(CopyLinkButton, _React$Component);
51
-
52
48
  var _super = _createSuper(CopyLinkButton);
53
-
54
49
  function CopyLinkButton() {
55
50
  var _this;
56
-
57
51
  _classCallCheck(this, CopyLinkButton);
58
-
59
52
  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
60
53
  args[_key] = arguments[_key];
61
54
  }
62
-
63
55
  _this = _super.call.apply(_super, [this].concat(args));
64
-
65
56
  _defineProperty(_assertThisInitialized(_this), "inputRef", /*#__PURE__*/React.createRef());
66
-
67
57
  _defineProperty(_assertThisInitialized(_this), "state", {
68
58
  shouldShowCopiedMessage: false
69
59
  });
70
-
71
60
  _defineProperty(_assertThisInitialized(_this), "clearAutoDismiss", function () {
72
61
  if (_this.autoDismiss) {
73
62
  clearTimeout(_this.autoDismiss);
74
63
  _this.autoDismiss = undefined;
75
64
  }
76
65
  });
77
-
78
66
  _defineProperty(_assertThisInitialized(_this), "handleClick", function () {
79
67
  _this.inputRef.current.select();
80
-
81
68
  document.execCommand('copy');
82
-
83
69
  if (_this.props.onLinkCopy) {
84
70
  _this.props.onLinkCopy(_this.props.link);
85
71
  }
86
-
87
72
  _this.setState({
88
73
  shouldShowCopiedMessage: true
89
74
  }, function () {
90
75
  _this.clearAutoDismiss();
91
-
92
76
  _this.autoDismiss = setTimeout(function () {
93
77
  _this.setState({
94
78
  shouldShowCopiedMessage: false
@@ -96,21 +80,18 @@ export var CopyLinkButton = /*#__PURE__*/function (_React$Component) {
96
80
  }, AUTO_DISMISS_MS);
97
81
  });
98
82
  });
99
-
100
83
  _defineProperty(_assertThisInitialized(_this), "handleDismissCopiedMessage", function () {
101
84
  _this.clearAutoDismiss();
102
-
103
85
  _this.setState({
104
86
  shouldShowCopiedMessage: false
105
87
  });
106
88
  });
107
-
108
89
  _defineProperty(_assertThisInitialized(_this), "renderTriggerButton", function (triggerProps) {
109
90
  var _this$props = _this.props,
110
- isDisabled = _this$props.isDisabled,
111
- copyLinkButtonText = _this$props.copyLinkButtonText,
112
- children = _this$props.children,
113
- iconBefore = _this$props.iconBefore;
91
+ isDisabled = _this$props.isDisabled,
92
+ copyLinkButtonText = _this$props.copyLinkButtonText,
93
+ children = _this$props.children,
94
+ iconBefore = _this$props.iconBefore;
114
95
  return jsx(Button, _extends({
115
96
  "aria-label": copyLinkButtonText,
116
97
  isDisabled: isDisabled,
@@ -122,10 +103,8 @@ export var CopyLinkButton = /*#__PURE__*/function (_React$Component) {
122
103
  onClick: _this.handleClick
123
104
  }, triggerProps), children || copyLinkButtonText);
124
105
  });
125
-
126
106
  return _this;
127
107
  }
128
-
129
108
  _createClass(CopyLinkButton, [{
130
109
  key: "componentWillUnmount",
131
110
  value: function componentWillUnmount() {
@@ -135,11 +114,10 @@ export var CopyLinkButton = /*#__PURE__*/function (_React$Component) {
135
114
  key: "render",
136
115
  value: function render() {
137
116
  var _this2 = this;
138
-
139
117
  var shouldShowCopiedMessage = this.state.shouldShowCopiedMessage;
140
118
  var _this$props2 = this.props,
141
- copyTooltipText = _this$props2.copyTooltipText,
142
- copiedToClipboardText = _this$props2.copiedToClipboardText;
119
+ copyTooltipText = _this$props2.copyTooltipText,
120
+ copiedToClipboardText = _this$props2.copiedToClipboardText;
143
121
  return jsx(React.Fragment, null, isSafari && jsx("div", {
144
122
  className: "assistive",
145
123
  "aria-live": "assertive"
@@ -171,7 +149,6 @@ export var CopyLinkButton = /*#__PURE__*/function (_React$Component) {
171
149
  }));
172
150
  }
173
151
  }]);
174
-
175
152
  return CopyLinkButton;
176
153
  }(React.Component);
177
154
  export default CopyLinkButton;