@atlaskit/share 4.9.0 → 4.11.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,17 @@
1
1
  # @atlaskit/share
2
2
 
3
+ ## 4.11.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#67391](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/67391) [`b569a250dbf5`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/b569a250dbf5) - Allow WorkspaceARI prop to be passed to component
8
+
9
+ ## 4.10.0
10
+
11
+ ### Minor Changes
12
+
13
+ - [#67129](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/67129) [`ecdf504e06ab`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/ecdf504e06ab) - Removed aria-expanded from share button, added aria-haspopup='dialog' to share button
14
+
3
15
  ## 4.9.0
4
16
 
5
17
  ### Minor Changes
@@ -18,7 +18,7 @@ function ShareButton(_ref, ref) {
18
18
  props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
19
19
  return /*#__PURE__*/_react.default.createElement(_customThemeButton.default, (0, _extends2.default)({
20
20
  ref: ref,
21
- "aria-expanded": props.isSelected
21
+ "aria-haspopup": "dialog"
22
22
  }, props), text);
23
23
  });
24
24
  ShareButton.displayName = 'ShareButton';
@@ -127,12 +127,14 @@ var ShareDialogContainerInternal = exports.ShareDialogContainerInternal = /*#__P
127
127
  shareAri = _this$props.shareAri,
128
128
  shareContentType = _this$props.shareContentType,
129
129
  shareTitle = _this$props.shareTitle,
130
- shareeAction = _this$props.shareeAction;
130
+ shareeAction = _this$props.shareeAction,
131
+ workspaceAri = _this$props.workspaceAri;
131
132
  var content = {
132
133
  ari: shareAri,
133
134
  link: shareLink,
134
135
  title: shareTitle,
135
- type: shareContentType
136
+ type: shareContentType,
137
+ workspaceAri: workspaceAri
136
138
  };
137
139
  var metaData = {
138
140
  productId: productId,
@@ -6,7 +6,6 @@ Object.defineProperty(exports, "__esModule", {
6
6
  });
7
7
  exports.defaultShareContentState = exports.ShareDialogWithTriggerInternal = exports.ShareDialogWithTrigger = void 0;
8
8
  var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
9
- var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
10
9
  var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
11
10
  var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
12
11
  var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
@@ -360,7 +359,7 @@ var ShareDialogWithTriggerInternal = exports.ShareDialogWithTriggerInternal = /*
360
359
  onClick: _this.onTriggerClick
361
360
  }, triggerProps);
362
361
  } else {
363
- button = (0, _react2.jsx)(_ShareButton.default, (0, _extends2.default)({
362
+ button = (0, _react2.jsx)(_ShareButton.default, {
364
363
  appearance: triggerButtonAppearance,
365
364
  text: triggerButtonStyle !== 'icon-only' ? (0, _react2.jsx)(_reactIntlNext.FormattedMessage, _i18n.messages.shareTriggerButtonText) : null,
366
365
  "aria-label": formatMessage(_i18n.messages.shareTriggerButtonText),
@@ -369,8 +368,9 @@ var ShareDialogWithTriggerInternal = exports.ShareDialogWithTriggerInternal = /*
369
368
  label: ""
370
369
  }) : undefined,
371
370
  isSelected: isDialogOpen,
372
- isDisabled: isDisabled
373
- }, triggerProps));
371
+ isDisabled: isDisabled,
372
+ ref: triggerProps.ref
373
+ });
374
374
  }
375
375
 
376
376
  // If the button only shows the icon, wrap it in a tooltip containing the button text.
@@ -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: "4.9.0"
16
+ packageVersion: "4.11.0"
17
17
  }, attributes);
18
18
  };
19
19
  var createEvent = function createEvent(eventType, source, action, actionSubject, actionSubjectId) {
@@ -10,7 +10,7 @@ function ShareButton({
10
10
  }, ref) {
11
11
  return /*#__PURE__*/React.createElement(Button, _extends({
12
12
  ref: ref,
13
- "aria-expanded": props.isSelected
13
+ "aria-haspopup": "dialog"
14
14
  }, props), text);
15
15
  });
16
16
  ShareButton.displayName = 'ShareButton';
@@ -91,13 +91,15 @@ export class ShareDialogContainerInternal extends React.Component {
91
91
  shareAri,
92
92
  shareContentType,
93
93
  shareTitle,
94
- shareeAction
94
+ shareeAction,
95
+ workspaceAri
95
96
  } = this.props;
96
97
  const content = {
97
98
  ari: shareAri,
98
99
  link: shareLink,
99
100
  title: shareTitle,
100
- type: shareContentType
101
+ type: shareContentType,
102
+ workspaceAri
101
103
  };
102
104
  const metaData = {
103
105
  productId,
@@ -1,4 +1,3 @@
1
- import _extends from "@babel/runtime/helpers/extends";
2
1
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
3
2
  /** @jsx jsx */
4
3
  import React from 'react';
@@ -341,7 +340,7 @@ export class ShareDialogWithTriggerInternal extends React.PureComponent {
341
340
  onClick: this.onTriggerClick
342
341
  }, triggerProps);
343
342
  } else {
344
- button = jsx(ShareButton, _extends({
343
+ button = jsx(ShareButton, {
345
344
  appearance: triggerButtonAppearance,
346
345
  text: triggerButtonStyle !== 'icon-only' ? jsx(FormattedMessage, messages.shareTriggerButtonText) : null,
347
346
  "aria-label": formatMessage(messages.shareTriggerButtonText),
@@ -350,8 +349,9 @@ export class ShareDialogWithTriggerInternal extends React.PureComponent {
350
349
  label: ""
351
350
  }) : undefined,
352
351
  isSelected: isDialogOpen,
353
- isDisabled: isDisabled
354
- }, triggerProps));
352
+ isDisabled: isDisabled,
353
+ ref: triggerProps.ref
354
+ });
355
355
  }
356
356
 
357
357
  // If the button only shows the icon, wrap it in a tooltip containing the button text.
@@ -1,7 +1,7 @@
1
1
  import { isEmail, isTeam, isUser } from '@atlaskit/smart-user-picker';
2
2
  const buildAttributes = (attributes = {}) => ({
3
3
  packageName: "@atlaskit/share",
4
- packageVersion: "4.9.0",
4
+ packageVersion: "4.11.0",
5
5
  ...attributes
6
6
  });
7
7
  const createEvent = (eventType, source, action, actionSubject, actionSubjectId, attributes = {}) => ({
@@ -11,7 +11,7 @@ function ShareButton(_ref, ref) {
11
11
  props = _objectWithoutProperties(_ref, _excluded);
12
12
  return /*#__PURE__*/React.createElement(Button, _extends({
13
13
  ref: ref,
14
- "aria-expanded": props.isSelected
14
+ "aria-haspopup": "dialog"
15
15
  }, props), text);
16
16
  });
17
17
  ShareButton.displayName = 'ShareButton';
@@ -120,12 +120,14 @@ export var ShareDialogContainerInternal = /*#__PURE__*/function (_React$Componen
120
120
  shareAri = _this$props.shareAri,
121
121
  shareContentType = _this$props.shareContentType,
122
122
  shareTitle = _this$props.shareTitle,
123
- shareeAction = _this$props.shareeAction;
123
+ shareeAction = _this$props.shareeAction,
124
+ workspaceAri = _this$props.workspaceAri;
124
125
  var content = {
125
126
  ari: shareAri,
126
127
  link: shareLink,
127
128
  title: shareTitle,
128
- type: shareContentType
129
+ type: shareContentType,
130
+ workspaceAri: workspaceAri
129
131
  };
130
132
  var metaData = {
131
133
  productId: productId,
@@ -1,4 +1,3 @@
1
- import _extends from "@babel/runtime/helpers/extends";
2
1
  import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
3
2
  import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
4
3
  import _createClass from "@babel/runtime/helpers/createClass";
@@ -356,7 +355,7 @@ export var ShareDialogWithTriggerInternal = /*#__PURE__*/function (_React$PureCo
356
355
  onClick: _this.onTriggerClick
357
356
  }, triggerProps);
358
357
  } else {
359
- button = jsx(ShareButton, _extends({
358
+ button = jsx(ShareButton, {
360
359
  appearance: triggerButtonAppearance,
361
360
  text: triggerButtonStyle !== 'icon-only' ? jsx(FormattedMessage, messages.shareTriggerButtonText) : null,
362
361
  "aria-label": formatMessage(messages.shareTriggerButtonText),
@@ -365,8 +364,9 @@ export var ShareDialogWithTriggerInternal = /*#__PURE__*/function (_React$PureCo
365
364
  label: ""
366
365
  }) : undefined,
367
366
  isSelected: isDialogOpen,
368
- isDisabled: isDisabled
369
- }, triggerProps));
367
+ isDisabled: isDisabled,
368
+ ref: triggerProps.ref
369
+ });
370
370
  }
371
371
 
372
372
  // If the button only shows the icon, wrap it in a tooltip containing the button text.
@@ -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: "4.9.0"
9
+ packageVersion: "4.11.0"
10
10
  }, attributes);
11
11
  };
12
12
  var createEvent = function createEvent(eventType, source, action, actionSubject, actionSubjectId) {
@@ -1,13 +1,13 @@
1
1
  import { ServiceConfig } from '@atlaskit/util-service-support';
2
2
  import { Comment, Content, MetaData, User } from '../types';
3
- export interface ShareClient {
4
- share(content: Content, recipients: User[], metadata: MetaData, comment?: Comment): Promise<ShareResponse>;
5
- getConfig(cloudId: string): Promise<ConfigResponse>;
6
- }
7
3
  export type ShareRequest = (content: Content, recipients: User[], metadata: MetaData, comment?: Comment) => Promise<ShareResponse>;
8
4
  export type ShareResponse = {
9
5
  shareRequestId: string;
10
6
  };
7
+ export interface ShareClient {
8
+ share: ShareRequest;
9
+ getConfig(cloudId: string): Promise<ConfigResponse>;
10
+ }
11
11
  export type ConfigResponse = {
12
12
  disableSharingToEmails?: boolean;
13
13
  };
@@ -50,7 +50,7 @@ export declare class ShareDialogContainerInternal extends React.Component<WithAn
50
50
  getFormShareLink: () => string;
51
51
  render(): JSX.Element;
52
52
  }
53
- export declare const ShareDialogContainer: React.ForwardRefExoticComponent<Pick<Omit<WithAnalyticsEventsProps & ShareDialogContainerProps, keyof WithAnalyticsEventsProps>, "onTriggerButtonClick" | "isAutoOpenDialog" | "shouldCloseOnEscapePress" | "dialogPlacement" | "loadUserOptions" | "onDialogOpen" | "onDialogClose" | "onUserSelectionChange" | "renderCustomTriggerButton" | "shareContentType" | "shareContentSubType" | "shareContentId" | "shareFormTitle" | "shareFormHelperMessage" | "showFlags" | "loggedInAccountId" | "triggerButtonAppearance" | "triggerButtonIcon" | "triggerButtonStyle" | "triggerButtonTooltipPosition" | "triggerButtonTooltipText" | "cloudId" | "bottomMessage" | "customFooter" | "isCopyDisabled" | "isPublicLink" | "integrationMode" | "shareFieldsFooter" | "shareIntegrations" | "shareAri" | "tabIndex" | "copyTooltipText" | "dialogZIndex" | "orgId" | "isBrowseUsersDisabled" | "shareClient" | "urlShortenerClient" | "shortLinkData" | "formatCopyLink" | "originTracingFactory" | "productId" | "shareLink" | "shareTitle" | "useUrlShortener"> & Partial<Pick<Omit<WithAnalyticsEventsProps & ShareDialogContainerProps, keyof WithAnalyticsEventsProps>, "enableSmartUserPicker" | "product" | "shareeAction">> & Partial<Pick<{
53
+ export declare const ShareDialogContainer: React.ForwardRefExoticComponent<Pick<Omit<WithAnalyticsEventsProps & ShareDialogContainerProps, keyof WithAnalyticsEventsProps>, "onTriggerButtonClick" | "isAutoOpenDialog" | "shouldCloseOnEscapePress" | "dialogPlacement" | "loadUserOptions" | "onDialogOpen" | "onDialogClose" | "onUserSelectionChange" | "renderCustomTriggerButton" | "shareContentType" | "shareContentSubType" | "shareContentId" | "shareFormTitle" | "shareFormHelperMessage" | "showFlags" | "loggedInAccountId" | "triggerButtonAppearance" | "triggerButtonIcon" | "triggerButtonStyle" | "triggerButtonTooltipPosition" | "triggerButtonTooltipText" | "cloudId" | "bottomMessage" | "customFooter" | "isCopyDisabled" | "isPublicLink" | "integrationMode" | "shareFieldsFooter" | "shareIntegrations" | "shareAri" | "tabIndex" | "copyTooltipText" | "dialogZIndex" | "orgId" | "isBrowseUsersDisabled" | "shareClient" | "urlShortenerClient" | "shortLinkData" | "formatCopyLink" | "originTracingFactory" | "productId" | "shareLink" | "shareTitle" | "useUrlShortener" | "workspaceAri"> & Partial<Pick<Omit<WithAnalyticsEventsProps & ShareDialogContainerProps, keyof WithAnalyticsEventsProps>, "enableSmartUserPicker" | "product" | "shareeAction">> & Partial<Pick<{
54
54
  enableSmartUserPicker: boolean;
55
55
  shareeAction: "view" | "edit";
56
56
  product: string;
@@ -149,4 +149,5 @@ export type ShareDialogContainerProps = {
149
149
  tabIndex?: number;
150
150
  copyTooltipText?: string;
151
151
  isBrowseUsersDisabled?: boolean;
152
+ workspaceAri?: string;
152
153
  };
@@ -4,6 +4,7 @@ export type Content = {
4
4
  link: string;
5
5
  title: string;
6
6
  type: string;
7
+ workspaceAri?: string;
7
8
  };
8
9
  export type Comment = {
9
10
  format: 'plain_text' | 'adf';
@@ -1,13 +1,13 @@
1
1
  import { ServiceConfig } from '@atlaskit/util-service-support';
2
2
  import { Comment, Content, MetaData, User } from '../types';
3
- export interface ShareClient {
4
- share(content: Content, recipients: User[], metadata: MetaData, comment?: Comment): Promise<ShareResponse>;
5
- getConfig(cloudId: string): Promise<ConfigResponse>;
6
- }
7
3
  export type ShareRequest = (content: Content, recipients: User[], metadata: MetaData, comment?: Comment) => Promise<ShareResponse>;
8
4
  export type ShareResponse = {
9
5
  shareRequestId: string;
10
6
  };
7
+ export interface ShareClient {
8
+ share: ShareRequest;
9
+ getConfig(cloudId: string): Promise<ConfigResponse>;
10
+ }
11
11
  export type ConfigResponse = {
12
12
  disableSharingToEmails?: boolean;
13
13
  };
@@ -50,7 +50,7 @@ export declare class ShareDialogContainerInternal extends React.Component<WithAn
50
50
  getFormShareLink: () => string;
51
51
  render(): JSX.Element;
52
52
  }
53
- export declare const ShareDialogContainer: React.ForwardRefExoticComponent<Pick<Omit<WithAnalyticsEventsProps & ShareDialogContainerProps, keyof WithAnalyticsEventsProps>, "onTriggerButtonClick" | "isAutoOpenDialog" | "shouldCloseOnEscapePress" | "dialogPlacement" | "loadUserOptions" | "onDialogOpen" | "onDialogClose" | "onUserSelectionChange" | "renderCustomTriggerButton" | "shareContentType" | "shareContentSubType" | "shareContentId" | "shareFormTitle" | "shareFormHelperMessage" | "showFlags" | "loggedInAccountId" | "triggerButtonAppearance" | "triggerButtonIcon" | "triggerButtonStyle" | "triggerButtonTooltipPosition" | "triggerButtonTooltipText" | "cloudId" | "bottomMessage" | "customFooter" | "isCopyDisabled" | "isPublicLink" | "integrationMode" | "shareFieldsFooter" | "shareIntegrations" | "shareAri" | "tabIndex" | "copyTooltipText" | "dialogZIndex" | "orgId" | "isBrowseUsersDisabled" | "shareClient" | "urlShortenerClient" | "shortLinkData" | "formatCopyLink" | "originTracingFactory" | "productId" | "shareLink" | "shareTitle" | "useUrlShortener"> & Partial<Pick<Omit<WithAnalyticsEventsProps & ShareDialogContainerProps, keyof WithAnalyticsEventsProps>, "enableSmartUserPicker" | "product" | "shareeAction">> & Partial<Pick<{
53
+ export declare const ShareDialogContainer: React.ForwardRefExoticComponent<Pick<Omit<WithAnalyticsEventsProps & ShareDialogContainerProps, keyof WithAnalyticsEventsProps>, "onTriggerButtonClick" | "isAutoOpenDialog" | "shouldCloseOnEscapePress" | "dialogPlacement" | "loadUserOptions" | "onDialogOpen" | "onDialogClose" | "onUserSelectionChange" | "renderCustomTriggerButton" | "shareContentType" | "shareContentSubType" | "shareContentId" | "shareFormTitle" | "shareFormHelperMessage" | "showFlags" | "loggedInAccountId" | "triggerButtonAppearance" | "triggerButtonIcon" | "triggerButtonStyle" | "triggerButtonTooltipPosition" | "triggerButtonTooltipText" | "cloudId" | "bottomMessage" | "customFooter" | "isCopyDisabled" | "isPublicLink" | "integrationMode" | "shareFieldsFooter" | "shareIntegrations" | "shareAri" | "tabIndex" | "copyTooltipText" | "dialogZIndex" | "orgId" | "isBrowseUsersDisabled" | "shareClient" | "urlShortenerClient" | "shortLinkData" | "formatCopyLink" | "originTracingFactory" | "productId" | "shareLink" | "shareTitle" | "useUrlShortener" | "workspaceAri"> & Partial<Pick<Omit<WithAnalyticsEventsProps & ShareDialogContainerProps, keyof WithAnalyticsEventsProps>, "enableSmartUserPicker" | "product" | "shareeAction">> & Partial<Pick<{
54
54
  enableSmartUserPicker: boolean;
55
55
  shareeAction: "view" | "edit";
56
56
  product: string;
@@ -149,4 +149,5 @@ export type ShareDialogContainerProps = {
149
149
  tabIndex?: number;
150
150
  copyTooltipText?: string;
151
151
  isBrowseUsersDisabled?: boolean;
152
+ workspaceAri?: string;
152
153
  };
@@ -4,6 +4,7 @@ export type Content = {
4
4
  link: string;
5
5
  title: string;
6
6
  type: string;
7
+ workspaceAri?: string;
7
8
  };
8
9
  export type Comment = {
9
10
  format: 'plain_text' | 'adf';
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@atlaskit/share",
3
- "version": "4.9.0",
3
+ "version": "4.11.0",
4
4
  "description": "Fabric Share Element",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
7
7
  },
8
- "repository": "https://bitbucket.org/atlassian/atlassian-frontend",
8
+ "repository": "https://bitbucket.org/atlassian/atlassian-frontend-mirror",
9
9
  "author": "Atlassian Pty Ltd",
10
10
  "license": "Apache-2.0",
11
11
  "main": "dist/cjs/index.js",