@atlaskit/share 6.8.1 → 6.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,27 @@
1
1
  # @atlaskit/share
2
2
 
3
+ ## 6.10.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#167224](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/167224)
8
+ [`198e371fcf6c7`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/198e371fcf6c7) -
9
+ We are testing adding `shouldRenderToProp` to Design System dropdown menu and popup components to
10
+ improve accessibility. If this fix is successful it will be available in a later release.
11
+
12
+ ## 6.9.0
13
+
14
+ ### Minor Changes
15
+
16
+ - [#164206](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/164206)
17
+ [`1e5b8f5ecfe7a`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/1e5b8f5ecfe7a) -
18
+ [ux] Hiding the success flag when the extended share form is submitted without any recipients
19
+ selected, also skipping share API calls when no recipients are present.
20
+
21
+ ### Patch Changes
22
+
23
+ - Updated dependencies
24
+
3
25
  ## 6.8.1
4
26
 
5
27
  ### Patch Changes
@@ -4,7 +4,7 @@
4
4
  "declaration": true,
5
5
  "target": "es5",
6
6
  "composite": true,
7
- "outDir": "../dist",
7
+ "outDir": "../../../../../confluence/tsDist/@atlaskit__share",
8
8
  "rootDir": "../"
9
9
  },
10
10
  "include": [
@@ -129,7 +129,8 @@ var ShareDialogContainerInternal = exports.ShareDialogContainerInternal = /*#__P
129
129
  shareContentType = _this$props.shareContentType,
130
130
  shareTitle = _this$props.shareTitle,
131
131
  shareeAction = _this$props.shareeAction,
132
- workspaceAri = _this$props.workspaceAri;
132
+ workspaceAri = _this$props.workspaceAri,
133
+ isExtendedShareDialogEnabled = _this$props.isExtendedShareDialogEnabled;
133
134
  var content = {
134
135
  ari: shareAri,
135
136
  link: shareLink,
@@ -146,6 +147,9 @@ var ShareDialogContainerInternal = exports.ShareDialogContainerInternal = /*#__P
146
147
  users: users,
147
148
  comment: comment
148
149
  }, rest));
150
+ if (isExtendedShareDialogEnabled && users.length === 0) {
151
+ return Promise.resolve();
152
+ }
149
153
  return _this.shareClient.share(content, (0, _utils.optionDataToUsers)(users), metaData, comment).then(function () {
150
154
  if (!_this._isMounted) {
151
155
  return;
@@ -264,7 +264,8 @@ var ShareDialogWithTriggerInternalLegacy = exports.ShareDialogWithTriggerInterna
264
264
  formShareOrigin = _this$props4.formShareOrigin,
265
265
  showFlags = _this$props4.showFlags,
266
266
  isPublicLink = _this$props4.isPublicLink,
267
- createAnalyticsEvent = _this$props4.createAnalyticsEvent;
267
+ createAnalyticsEvent = _this$props4.createAnalyticsEvent,
268
+ isExtendedShareDialogEnabled = _this$props4.isExtendedShareDialogEnabled;
268
269
  if (!onShareSubmit) {
269
270
  return;
270
271
  }
@@ -301,8 +302,12 @@ var ShareDialogWithTriggerInternalLegacy = exports.ShareDialogWithTriggerInterna
301
302
  _this.setState({
302
303
  isSharing: false
303
304
  });
304
- showFlags(_this.getFlags());
305
- _ufoExperiences.shareSubmitExp.success();
305
+ if (isExtendedShareDialogEnabled && data.users.length === 0) {
306
+ _ufoExperiences.shareSubmitExp.abort();
307
+ } else {
308
+ showFlags(_this.getFlags());
309
+ _ufoExperiences.shareSubmitExp.success();
310
+ }
306
311
  }).catch( /*#__PURE__*/function () {
307
312
  var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(err) {
308
313
  var shareError;
@@ -262,7 +262,8 @@ var ShareDialogWithTriggerInternal = exports.ShareDialogWithTriggerInternal = /*
262
262
  shareContentId = _this$props4.shareContentId,
263
263
  formShareOrigin = _this$props4.formShareOrigin,
264
264
  showFlags = _this$props4.showFlags,
265
- isPublicLink = _this$props4.isPublicLink;
265
+ isPublicLink = _this$props4.isPublicLink,
266
+ isExtendedShareDialogEnabled = _this$props4.isExtendedShareDialogEnabled;
266
267
  if (!onShareSubmit) {
267
268
  return;
268
269
  }
@@ -284,8 +285,12 @@ var ShareDialogWithTriggerInternal = exports.ShareDialogWithTriggerInternal = /*
284
285
  _this.setState({
285
286
  isSharing: false
286
287
  });
287
- showFlags(_this.getFlags());
288
- _ufoExperiences.shareSubmitExp.success();
288
+ if (isExtendedShareDialogEnabled && data.users.length === 0) {
289
+ _ufoExperiences.shareSubmitExp.abort();
290
+ } else {
291
+ showFlags(_this.getFlags());
292
+ _ufoExperiences.shareSubmitExp.success();
293
+ }
289
294
  }).catch( /*#__PURE__*/function () {
290
295
  var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(err) {
291
296
  var shareError;
@@ -82,7 +82,8 @@ var SplitButtonDropdown = function SplitButtonDropdown(props) {
82
82
  },
83
83
  placement: "bottom-end",
84
84
  isOpen: isUsingSplitButton,
85
- onOpenChange: onOpenChange
85
+ onOpenChange: onOpenChange,
86
+ shouldRenderToParent: (0, _platformFeatureFlags.fg)('should-render-to-parent-should-be-true-people-and-')
86
87
  }, (0, _react2.jsx)(_dropdownMenu.DropdownItemGroup, null, shareIntegrations.map(function (integration) {
87
88
  return (0, _react2.jsx)(_dropdownMenu.DropdownItem, {
88
89
  key: integration.type,
@@ -13,7 +13,7 @@ var buildAttributes = function buildAttributes() {
13
13
  var attributes = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
14
14
  return _objectSpread({
15
15
  packageName: "@atlaskit/share",
16
- packageVersion: "6.8.1"
16
+ packageVersion: "6.10.0"
17
17
  }, attributes);
18
18
  };
19
19
  var createEvent = function createEvent(eventType, source, action, actionSubject, actionSubjectId) {
@@ -94,7 +94,8 @@ export class ShareDialogContainerInternal extends React.Component {
94
94
  shareContentType,
95
95
  shareTitle,
96
96
  shareeAction,
97
- workspaceAri
97
+ workspaceAri,
98
+ isExtendedShareDialogEnabled
98
99
  } = this.props;
99
100
  const content = {
100
101
  ari: shareAri,
@@ -113,6 +114,9 @@ export class ShareDialogContainerInternal extends React.Component {
113
114
  comment,
114
115
  ...rest
115
116
  });
117
+ if (isExtendedShareDialogEnabled && users.length === 0) {
118
+ return Promise.resolve();
119
+ }
116
120
  return this.shareClient.share(content, optionDataToUsers(users), metaData, comment).then(() => {
117
121
  if (!this._isMounted) {
118
122
  return;
@@ -262,7 +262,8 @@ export class ShareDialogWithTriggerInternalLegacy extends React.PureComponent {
262
262
  formShareOrigin,
263
263
  showFlags,
264
264
  isPublicLink,
265
- createAnalyticsEvent
265
+ createAnalyticsEvent,
266
+ isExtendedShareDialogEnabled
266
267
  } = this.props;
267
268
  if (!onShareSubmit) {
268
269
  return;
@@ -300,8 +301,12 @@ export class ShareDialogWithTriggerInternalLegacy extends React.PureComponent {
300
301
  this.setState({
301
302
  isSharing: false
302
303
  });
303
- showFlags(this.getFlags());
304
- shareSubmitExp.success();
304
+ if (isExtendedShareDialogEnabled && data.users.length === 0) {
305
+ shareSubmitExp.abort();
306
+ } else {
307
+ showFlags(this.getFlags());
308
+ shareSubmitExp.success();
309
+ }
305
310
  }).catch(async err => {
306
311
  const shareError = await this.generateShareError(err).catch(errorGenFailed => ({
307
312
  message: err.message || errorGenFailed.message || 'Unknown error',
@@ -254,7 +254,8 @@ export class ShareDialogWithTriggerInternal extends React.PureComponent {
254
254
  shareContentId,
255
255
  formShareOrigin,
256
256
  showFlags,
257
- isPublicLink
257
+ isPublicLink,
258
+ isExtendedShareDialogEnabled
258
259
  } = this.props;
259
260
  if (!onShareSubmit) {
260
261
  return;
@@ -277,8 +278,12 @@ export class ShareDialogWithTriggerInternal extends React.PureComponent {
277
278
  this.setState({
278
279
  isSharing: false
279
280
  });
280
- showFlags(this.getFlags());
281
- shareSubmitExp.success();
281
+ if (isExtendedShareDialogEnabled && data.users.length === 0) {
282
+ shareSubmitExp.abort();
283
+ } else {
284
+ showFlags(this.getFlags());
285
+ shareSubmitExp.success();
286
+ }
282
287
  }).catch(async err => {
283
288
  const shareError = await this.generateShareError(err).catch(errorGenFailed => ({
284
289
  message: err.message || errorGenFailed.message || 'Unknown error',
@@ -73,7 +73,8 @@ const SplitButtonDropdown = props => {
73
73
  })),
74
74
  placement: "bottom-end",
75
75
  isOpen: isUsingSplitButton,
76
- onOpenChange: onOpenChange
76
+ onOpenChange: onOpenChange,
77
+ shouldRenderToParent: fg('should-render-to-parent-should-be-true-people-and-')
77
78
  }, jsx(DropdownItemGroup, null, shareIntegrations.map(integration => jsx(DropdownItem, {
78
79
  key: integration.type,
79
80
  testId: `split-button-dropdownitem-${integration.type}`
@@ -1,7 +1,7 @@
1
1
  import { isEmail, isExternalUser, isGroup, isTeam, isUser } from '@atlaskit/smart-user-picker';
2
2
  const buildAttributes = (attributes = {}) => ({
3
3
  packageName: "@atlaskit/share",
4
- packageVersion: "6.8.1",
4
+ packageVersion: "6.10.0",
5
5
  ...attributes
6
6
  });
7
7
  const createEvent = (eventType, source, action, actionSubject, actionSubjectId, attributes = {}) => ({
@@ -122,7 +122,8 @@ export var ShareDialogContainerInternal = /*#__PURE__*/function (_React$Componen
122
122
  shareContentType = _this$props.shareContentType,
123
123
  shareTitle = _this$props.shareTitle,
124
124
  shareeAction = _this$props.shareeAction,
125
- workspaceAri = _this$props.workspaceAri;
125
+ workspaceAri = _this$props.workspaceAri,
126
+ isExtendedShareDialogEnabled = _this$props.isExtendedShareDialogEnabled;
126
127
  var content = {
127
128
  ari: shareAri,
128
129
  link: shareLink,
@@ -139,6 +140,9 @@ export var ShareDialogContainerInternal = /*#__PURE__*/function (_React$Componen
139
140
  users: users,
140
141
  comment: comment
141
142
  }, rest));
143
+ if (isExtendedShareDialogEnabled && users.length === 0) {
144
+ return Promise.resolve();
145
+ }
142
146
  return _this.shareClient.share(content, optionDataToUsers(users), metaData, comment).then(function () {
143
147
  if (!_this._isMounted) {
144
148
  return;
@@ -263,7 +263,8 @@ export var ShareDialogWithTriggerInternalLegacy = /*#__PURE__*/function (_React$
263
263
  formShareOrigin = _this$props4.formShareOrigin,
264
264
  showFlags = _this$props4.showFlags,
265
265
  isPublicLink = _this$props4.isPublicLink,
266
- createAnalyticsEvent = _this$props4.createAnalyticsEvent;
266
+ createAnalyticsEvent = _this$props4.createAnalyticsEvent,
267
+ isExtendedShareDialogEnabled = _this$props4.isExtendedShareDialogEnabled;
267
268
  if (!onShareSubmit) {
268
269
  return;
269
270
  }
@@ -300,8 +301,12 @@ export var ShareDialogWithTriggerInternalLegacy = /*#__PURE__*/function (_React$
300
301
  _this.setState({
301
302
  isSharing: false
302
303
  });
303
- showFlags(_this.getFlags());
304
- shareSubmitExp.success();
304
+ if (isExtendedShareDialogEnabled && data.users.length === 0) {
305
+ shareSubmitExp.abort();
306
+ } else {
307
+ showFlags(_this.getFlags());
308
+ shareSubmitExp.success();
309
+ }
305
310
  }).catch( /*#__PURE__*/function () {
306
311
  var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(err) {
307
312
  var shareError;
@@ -255,7 +255,8 @@ export var ShareDialogWithTriggerInternal = /*#__PURE__*/function (_React$PureCo
255
255
  shareContentId = _this$props4.shareContentId,
256
256
  formShareOrigin = _this$props4.formShareOrigin,
257
257
  showFlags = _this$props4.showFlags,
258
- isPublicLink = _this$props4.isPublicLink;
258
+ isPublicLink = _this$props4.isPublicLink,
259
+ isExtendedShareDialogEnabled = _this$props4.isExtendedShareDialogEnabled;
259
260
  if (!onShareSubmit) {
260
261
  return;
261
262
  }
@@ -277,8 +278,12 @@ export var ShareDialogWithTriggerInternal = /*#__PURE__*/function (_React$PureCo
277
278
  _this.setState({
278
279
  isSharing: false
279
280
  });
280
- showFlags(_this.getFlags());
281
- shareSubmitExp.success();
281
+ if (isExtendedShareDialogEnabled && data.users.length === 0) {
282
+ shareSubmitExp.abort();
283
+ } else {
284
+ showFlags(_this.getFlags());
285
+ shareSubmitExp.success();
286
+ }
282
287
  }).catch( /*#__PURE__*/function () {
283
288
  var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(err) {
284
289
  var shareError;
@@ -75,7 +75,8 @@ var SplitButtonDropdown = function SplitButtonDropdown(props) {
75
75
  },
76
76
  placement: "bottom-end",
77
77
  isOpen: isUsingSplitButton,
78
- onOpenChange: onOpenChange
78
+ onOpenChange: onOpenChange,
79
+ shouldRenderToParent: fg('should-render-to-parent-should-be-true-people-and-')
79
80
  }, jsx(DropdownItemGroup, null, shareIntegrations.map(function (integration) {
80
81
  return jsx(DropdownItem, {
81
82
  key: integration.type,
@@ -6,7 +6,7 @@ var buildAttributes = function buildAttributes() {
6
6
  var attributes = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
7
7
  return _objectSpread({
8
8
  packageName: "@atlaskit/share",
9
- packageVersion: "6.8.1"
9
+ packageVersion: "6.10.0"
10
10
  }, attributes);
11
11
  };
12
12
  var createEvent = function createEvent(eventType, source, action, actionSubject, actionSubjectId) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/share",
3
- "version": "6.8.1",
3
+ "version": "6.10.0",
4
4
  "description": "Fabric Share Element",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -57,8 +57,8 @@
57
57
  "@atlaskit/tabs": "^18.1.0",
58
58
  "@atlaskit/textarea": "^8.0.0",
59
59
  "@atlaskit/theme": "^18.0.0",
60
- "@atlaskit/tokens": "^5.0.0",
61
- "@atlaskit/tooltip": "^20.2.0",
60
+ "@atlaskit/tokens": "^5.1.0",
61
+ "@atlaskit/tooltip": "^20.3.0",
62
62
  "@atlaskit/ufo": "^0.4.0",
63
63
  "@atlaskit/user-picker": "^11.2.0",
64
64
  "@atlaskit/util-service-support": "^6.3.0",
@@ -139,6 +139,9 @@
139
139
  },
140
140
  "dst-a11y__replace-anchor-with-link__people-and-tea": {
141
141
  "type": "boolean"
142
+ },
143
+ "should-render-to-parent-should-be-true-people-and-": {
144
+ "type": "boolean"
142
145
  }
143
146
  },
144
147
  "sideEffects": [