@atlaskit/share 0.34.2 → 0.34.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @atlaskit/share
2
2
 
3
+ ## 0.34.3
4
+
5
+ ### Patch Changes
6
+
7
+ - [`d506d312f89`](https://bitbucket.org/atlassian/atlassian-frontend/commits/d506d312f89) - Updating ts Type to be string restricted for easier use. Tests updated to accommodate.
8
+
3
9
  ## 0.34.2
4
10
 
5
11
  ### Patch Changes
@@ -5,7 +5,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
- exports.ShareServiceClient = exports.DEFAULT_SHARE_SERVICE_URL = exports.SHARE_CONFIG_PATH = exports.DEFAULT_SHARE_PATH = void 0;
8
+ exports.ShareServiceClient = exports.SHARE_CONFIG_PATH = exports.DEFAULT_SHARE_SERVICE_URL = exports.DEFAULT_SHARE_PATH = void 0;
9
9
 
10
10
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
11
11
 
@@ -7,7 +7,7 @@ var _typeof = require("@babel/runtime/helpers/typeof");
7
7
  Object.defineProperty(exports, "__esModule", {
8
8
  value: true
9
9
  });
10
- exports.default = exports.CopyLinkButton = exports.HiddenInput = exports.MessageContainer = exports.AUTO_DISMISS_MS = void 0;
10
+ exports.default = exports.MessageContainer = exports.HiddenInput = exports.CopyLinkButton = exports.AUTO_DISMISS_MS = void 0;
11
11
 
12
12
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
13
13
 
@@ -5,7 +5,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
- exports.ShareDialogContainer = exports.ShareDialogContainerInternal = exports.defaultConfig = void 0;
8
+ exports.defaultConfig = exports.ShareDialogContainerInternal = exports.ShareDialogContainer = void 0;
9
9
 
10
10
  var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
11
11
 
@@ -5,7 +5,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
- exports.ShareDialogWithTrigger = exports.ShareDialogWithTriggerInternal = exports.defaultShareContentState = void 0;
8
+ exports.defaultShareContentState = exports.ShareDialogWithTriggerInternal = exports.ShareDialogWithTrigger = void 0;
9
9
 
10
10
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
11
11
 
@@ -61,8 +61,6 @@ var _styles = require("./styles");
61
61
 
62
62
  var _IntegrationForm = require("./IntegrationForm");
63
63
 
64
- var _ShareEntities = require("../types/ShareEntities");
65
-
66
64
  var _templateObject, _templateObject2, _templateObject3, _templateObject4;
67
65
 
68
66
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
@@ -366,7 +364,7 @@ var ShareDialogWithTriggerInternal = /*#__PURE__*/function (_React$PureComponent
366
364
  } // If there are any integrations, wrap the share button in a split button with integrations.
367
365
 
368
366
 
369
- if (integrationMode === _ShareEntities.IntegrationMode.Split && shareIntegrations !== null && shareIntegrations !== void 0 && shareIntegrations.length) {
367
+ if (integrationMode === 'split' && shareIntegrations !== null && shareIntegrations !== void 0 && shareIntegrations.length) {
370
368
  button = /*#__PURE__*/_react.default.createElement(_SplitButton.default, {
371
369
  shareButton: button,
372
370
  handleOpenSplitButton: _this.handleOpenSplitButton,
@@ -474,7 +472,7 @@ var ShareDialogWithTriggerInternal = /*#__PURE__*/function (_React$PureComponent
474
472
  isSharing: isSharing,
475
473
  onSubmit: _this2.handleShareSubmit,
476
474
  title: shareFormTitle,
477
- showTitle: integrationMode !== _ShareEntities.IntegrationMode.Tabs || !shareIntegrations || !shareIntegrations.length,
475
+ showTitle: integrationMode !== 'tabs' || !shareIntegrations || !shareIntegrations.length,
478
476
  helperMessage: shareFormHelperMessage,
479
477
  shareError: shareError,
480
478
  onDismiss: _this2.handleFormDismiss,
@@ -7,9 +7,7 @@ var _typeof = require("@babel/runtime/helpers/typeof");
7
7
  Object.defineProperty(exports, "__esModule", {
8
8
  value: true
9
9
  });
10
- exports.ShareForm = exports.FormFooter = exports.FormWrapper = void 0;
11
-
12
- var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
10
+ exports.ShareForm = exports.FormWrapper = exports.FormFooter = void 0;
13
11
 
14
12
  var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
15
13
 
@@ -25,6 +23,8 @@ var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/ge
25
23
 
26
24
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
27
25
 
26
+ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
27
+
28
28
  var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
29
29
 
30
30
  var _customThemeButton = _interopRequireDefault(require("@atlaskit/button/custom-theme-button"));
@@ -59,8 +59,6 @@ var _UserPickerField = require("./UserPickerField");
59
59
 
60
60
  var _IntegrationForm = require("./IntegrationForm");
61
61
 
62
- var _ShareEntities = require("../types/ShareEntities");
63
-
64
62
  var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7;
65
63
 
66
64
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
@@ -91,6 +89,14 @@ var IntegrationWrapper = _styledComponents.default.div(_templateObject6 || (_tem
91
89
 
92
90
  var IntegrationIconWrapper = _styledComponents.default.span(_templateObject7 || (_templateObject7 = (0, _taggedTemplateLiteral2.default)(["\n margin-right: 5px;\n"])));
93
91
 
92
+ var integrationTabText = function integrationTabText(integrationName) {
93
+ return /*#__PURE__*/_react.default.createElement(_reactIntl.FormattedMessage, (0, _extends2.default)({}, _i18n.messages.shareInIntegrationButtonText, {
94
+ values: {
95
+ integrationName: integrationName
96
+ }
97
+ }));
98
+ };
99
+
94
100
  var InternalForm = /*#__PURE__*/function (_React$PureComponent) {
95
101
  (0, _inherits2.default)(InternalForm, _React$PureComponent);
96
102
 
@@ -202,23 +208,23 @@ var InternalForm = /*#__PURE__*/function (_React$PureComponent) {
202
208
  var _this$props4 = this.props,
203
209
  title = _this$props4.title,
204
210
  _this$props4$integrat = _this$props4.integrationMode,
205
- integrationMode = _this$props4$integrat === void 0 ? _ShareEntities.IntegrationMode.Off : _this$props4$integrat,
211
+ integrationMode = _this$props4$integrat === void 0 ? 'off' : _this$props4$integrat,
206
212
  shareIntegrations = _this$props4.shareIntegrations;
207
213
 
208
- if (integrationMode === _ShareEntities.IntegrationMode.Off || !shareIntegrations || !shareIntegrations.length) {
214
+ if (integrationMode === 'off' || !shareIntegrations || !shareIntegrations.length) {
209
215
  return this.renderShareForm();
210
216
  }
211
217
 
212
218
  var firstIntegration = shareIntegrations[0];
213
219
 
214
- if (integrationMode === _ShareEntities.IntegrationMode.Tabs) {
220
+ if (integrationMode === 'tabs') {
215
221
  return /*#__PURE__*/_react.default.createElement(_tabs.default, {
216
222
  id: "ShareForm-Tabs-Integrations"
217
223
  }, /*#__PURE__*/_react.default.createElement(_tabs.TabList, null, /*#__PURE__*/_react.default.createElement(_tabs.Tab, {
218
224
  key: "share-tab-default"
219
225
  }, title || /*#__PURE__*/_react.default.createElement(_reactIntl.FormattedMessage, _i18n.messages.formTitle)), /*#__PURE__*/_react.default.createElement(_tabs.Tab, {
220
226
  key: "share-tab-".concat(firstIntegration.type)
221
- }, /*#__PURE__*/_react.default.createElement(IntegrationWrapper, null, /*#__PURE__*/_react.default.createElement(IntegrationIconWrapper, null, /*#__PURE__*/_react.default.createElement(firstIntegration.Icon, null)), firstIntegration.type))), /*#__PURE__*/_react.default.createElement(_tabs.TabPanel, {
227
+ }, /*#__PURE__*/_react.default.createElement(IntegrationWrapper, null, /*#__PURE__*/_react.default.createElement(IntegrationIconWrapper, null, /*#__PURE__*/_react.default.createElement(firstIntegration.Icon, null)), integrationTabText(firstIntegration.type)))), /*#__PURE__*/_react.default.createElement(_tabs.TabPanel, {
222
228
  key: "share-tabPanel-default"
223
229
  }, /*#__PURE__*/_react.default.createElement(FormWrapper, {
224
230
  isMainShare: true
@@ -5,7 +5,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
- exports.formShareSubmitted = exports.copyLinkButtonClicked = exports.shortUrlGenerated = exports.shortUrlRequested = exports.cancelShare = exports.shareTriggerButtonClicked = exports.errorEncountered = exports.shareIntegrationButtonEvent = exports.shareSplitButtonEvent = exports.screenEvent = exports.INTEGRATION_MODAL_SOURCE = exports.ANALYTICS_SOURCE = exports.CHANNEL_ID = void 0;
8
+ exports.shortUrlRequested = exports.shortUrlGenerated = exports.shareTriggerButtonClicked = exports.shareSplitButtonEvent = exports.shareIntegrationButtonEvent = exports.screenEvent = exports.formShareSubmitted = exports.errorEncountered = exports.copyLinkButtonClicked = exports.cancelShare = exports.INTEGRATION_MODAL_SOURCE = exports.CHANNEL_ID = exports.ANALYTICS_SOURCE = void 0;
9
9
 
10
10
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
11
11
 
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.setIsOnboardingDismissed = exports.getIsOnboardingDismissed = exports.setDefaultSlackWorkSpace = exports.getDefaultSlackWorkSpace = void 0;
6
+ exports.setIsOnboardingDismissed = exports.setDefaultSlackWorkSpace = exports.getIsOnboardingDismissed = exports.getDefaultSlackWorkSpace = void 0;
7
7
 
8
8
  var getLocalStorageKey = function getLocalStorageKey(key) {
9
9
  try {
@@ -5,7 +5,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
- exports.default = exports.InlineDialogContentWrapper = exports.MAX_PICKER_HEIGHT = void 0;
8
+ exports.default = exports.MAX_PICKER_HEIGHT = exports.InlineDialogContentWrapper = void 0;
9
9
 
10
10
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
11
11
 
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.allowEmails = exports.optionDataToUsers = exports.getMenuPortalTargetCurrentHTML = exports.generateSelectZIndex = exports.zIndexAddition = void 0;
6
+ exports.zIndexAddition = exports.optionDataToUsers = exports.getMenuPortalTargetCurrentHTML = exports.generateSelectZIndex = exports.allowEmails = void 0;
7
7
 
8
8
  var _theme = require("@atlaskit/theme");
9
9
 
@@ -5,34 +5,46 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
- Object.defineProperty(exports, "zh", {
8
+ Object.defineProperty(exports, "cs", {
9
9
  enumerable: true,
10
10
  get: function get() {
11
- return _zh.default;
11
+ return _cs.default;
12
12
  }
13
13
  });
14
- Object.defineProperty(exports, "zh_TW", {
14
+ Object.defineProperty(exports, "da", {
15
15
  enumerable: true,
16
16
  get: function get() {
17
- return _zh_TW.default;
17
+ return _da.default;
18
18
  }
19
19
  });
20
- Object.defineProperty(exports, "cs", {
20
+ Object.defineProperty(exports, "de", {
21
21
  enumerable: true,
22
22
  get: function get() {
23
- return _cs.default;
23
+ return _de.default;
24
24
  }
25
25
  });
26
- Object.defineProperty(exports, "da", {
26
+ Object.defineProperty(exports, "en", {
27
27
  enumerable: true,
28
28
  get: function get() {
29
- return _da.default;
29
+ return _en.default;
30
30
  }
31
31
  });
32
- Object.defineProperty(exports, "nl", {
32
+ Object.defineProperty(exports, "en_GB", {
33
33
  enumerable: true,
34
34
  get: function get() {
35
- return _nl.default;
35
+ return _en_GB.default;
36
+ }
37
+ });
38
+ Object.defineProperty(exports, "en_ZZ", {
39
+ enumerable: true,
40
+ get: function get() {
41
+ return _en_ZZ.default;
42
+ }
43
+ });
44
+ Object.defineProperty(exports, "es", {
45
+ enumerable: true,
46
+ get: function get() {
47
+ return _es.default;
36
48
  }
37
49
  });
38
50
  Object.defineProperty(exports, "et", {
@@ -53,16 +65,16 @@ Object.defineProperty(exports, "fr", {
53
65
  return _fr.default;
54
66
  }
55
67
  });
56
- Object.defineProperty(exports, "de", {
68
+ Object.defineProperty(exports, "hu", {
57
69
  enumerable: true,
58
70
  get: function get() {
59
- return _de.default;
71
+ return _hu.default;
60
72
  }
61
73
  });
62
- Object.defineProperty(exports, "hu", {
74
+ Object.defineProperty(exports, "is", {
63
75
  enumerable: true,
64
76
  get: function get() {
65
- return _hu.default;
77
+ return _is.default;
66
78
  }
67
79
  });
68
80
  Object.defineProperty(exports, "it", {
@@ -89,6 +101,12 @@ Object.defineProperty(exports, "nb", {
89
101
  return _nb.default;
90
102
  }
91
103
  });
104
+ Object.defineProperty(exports, "nl", {
105
+ enumerable: true,
106
+ get: function get() {
107
+ return _nl.default;
108
+ }
109
+ });
92
110
  Object.defineProperty(exports, "pl", {
93
111
  enumerable: true,
94
112
  get: function get() {
@@ -107,22 +125,22 @@ Object.defineProperty(exports, "pt_PT", {
107
125
  return _pt_PT.default;
108
126
  }
109
127
  });
110
- Object.defineProperty(exports, "ru", {
128
+ Object.defineProperty(exports, "ro", {
111
129
  enumerable: true,
112
130
  get: function get() {
113
- return _ru.default;
131
+ return _ro.default;
114
132
  }
115
133
  });
116
- Object.defineProperty(exports, "sk", {
134
+ Object.defineProperty(exports, "ru", {
117
135
  enumerable: true,
118
136
  get: function get() {
119
- return _sk.default;
137
+ return _ru.default;
120
138
  }
121
139
  });
122
- Object.defineProperty(exports, "es", {
140
+ Object.defineProperty(exports, "sk", {
123
141
  enumerable: true,
124
142
  get: function get() {
125
- return _es.default;
143
+ return _sk.default;
126
144
  }
127
145
  });
128
146
  Object.defineProperty(exports, "sv", {
@@ -155,34 +173,16 @@ Object.defineProperty(exports, "vi", {
155
173
  return _vi.default;
156
174
  }
157
175
  });
158
- Object.defineProperty(exports, "en_ZZ", {
159
- enumerable: true,
160
- get: function get() {
161
- return _en_ZZ.default;
162
- }
163
- });
164
- Object.defineProperty(exports, "en", {
165
- enumerable: true,
166
- get: function get() {
167
- return _en.default;
168
- }
169
- });
170
- Object.defineProperty(exports, "en_GB", {
171
- enumerable: true,
172
- get: function get() {
173
- return _en_GB.default;
174
- }
175
- });
176
- Object.defineProperty(exports, "is", {
176
+ Object.defineProperty(exports, "zh", {
177
177
  enumerable: true,
178
178
  get: function get() {
179
- return _is.default;
179
+ return _zh.default;
180
180
  }
181
181
  });
182
- Object.defineProperty(exports, "ro", {
182
+ Object.defineProperty(exports, "zh_TW", {
183
183
  enumerable: true,
184
184
  get: function get() {
185
- return _ro.default;
185
+ return _zh_TW.default;
186
186
  }
187
187
  });
188
188
 
package/dist/cjs/i18n.js CHANGED
@@ -163,6 +163,11 @@ var messages = (0, _reactIntl.defineMessages)({
163
163
  id: 'fabric.elements.share.to.integration.button',
164
164
  defaultMessage: 'Share to {integrationName}',
165
165
  description: 'Text for the button that allows the user to share the currently viewed item through a 3rd party app like Slack'
166
+ },
167
+ shareInIntegrationButtonText: {
168
+ id: 'fabric.elements.share.in.integration.button',
169
+ defaultMessage: 'Share in {integrationName}',
170
+ description: 'Text for the button that allows the user to share the currently viewed item through a 3rd party app like Slack'
166
171
  }
167
172
  });
168
173
  exports.messages = messages;
package/dist/cjs/index.js CHANGED
@@ -3,28 +3,28 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- Object.defineProperty(exports, "ShareServiceClient", {
6
+ Object.defineProperty(exports, "ADMIN_NOTIFIED", {
7
7
  enumerable: true,
8
8
  get: function get() {
9
- return _ShareServiceClient.ShareServiceClient;
9
+ return _types.ADMIN_NOTIFIED;
10
10
  }
11
11
  });
12
- Object.defineProperty(exports, "ShareDialogContainer", {
12
+ Object.defineProperty(exports, "OBJECT_SHARED", {
13
13
  enumerable: true,
14
14
  get: function get() {
15
- return _ShareDialogContainer.ShareDialogContainer;
15
+ return _types.OBJECT_SHARED;
16
16
  }
17
17
  });
18
- Object.defineProperty(exports, "ADMIN_NOTIFIED", {
18
+ Object.defineProperty(exports, "ShareDialogContainer", {
19
19
  enumerable: true,
20
20
  get: function get() {
21
- return _types.ADMIN_NOTIFIED;
21
+ return _ShareDialogContainer.ShareDialogContainer;
22
22
  }
23
23
  });
24
- Object.defineProperty(exports, "OBJECT_SHARED", {
24
+ Object.defineProperty(exports, "ShareServiceClient", {
25
25
  enumerable: true,
26
26
  get: function get() {
27
- return _types.OBJECT_SHARED;
27
+ return _ShareServiceClient.ShareServiceClient;
28
28
  }
29
29
  });
30
30
 
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.ADMIN_NOTIFIED = exports.OBJECT_SHARED = void 0;
6
+ exports.OBJECT_SHARED = exports.ADMIN_NOTIFIED = void 0;
7
7
  var OBJECT_SHARED = 'object-shared';
8
8
  exports.OBJECT_SHARED = OBJECT_SHARED;
9
9
  var ADMIN_NOTIFIED = 'admin-notified';
@@ -2,14 +2,4 @@
2
2
 
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
- });
6
- exports.IntegrationMode = void 0;
7
- // Third party integrations
8
- var IntegrationMode;
9
- exports.IntegrationMode = IntegrationMode;
10
-
11
- (function (IntegrationMode) {
12
- IntegrationMode[IntegrationMode["Tabs"] = 0] = "Tabs";
13
- IntegrationMode[IntegrationMode["Split"] = 1] = "Split";
14
- IntegrationMode[IntegrationMode["Off"] = 2] = "Off";
15
- })(IntegrationMode || (exports.IntegrationMode = IntegrationMode = {}));
5
+ });
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "name": "@atlaskit/share",
3
- "version": "0.34.2"
3
+ "version": "0.34.3"
4
4
  }
@@ -18,7 +18,6 @@ import { ShareForm } from './ShareForm';
18
18
  import { generateSelectZIndex } from './utils';
19
19
  import { InlineDialogContentWrapper } from './styles';
20
20
  import { IntegrationForm } from './IntegrationForm';
21
- import { IntegrationMode } from '../types/ShareEntities';
22
21
  const ShareButtonWrapper = styled.div`
23
22
  display: inline-flex;
24
23
  outline: none;
@@ -330,7 +329,7 @@ export class ShareDialogWithTriggerInternal extends React.PureComponent {
330
329
  } // If there are any integrations, wrap the share button in a split button with integrations.
331
330
 
332
331
 
333
- if (integrationMode === IntegrationMode.Split && shareIntegrations !== null && shareIntegrations !== void 0 && shareIntegrations.length) {
332
+ if (integrationMode === 'split' && shareIntegrations !== null && shareIntegrations !== void 0 && shareIntegrations.length) {
334
333
  button = /*#__PURE__*/React.createElement(SplitButton, {
335
334
  shareButton: button,
336
335
  handleOpenSplitButton: this.handleOpenSplitButton,
@@ -431,7 +430,7 @@ export class ShareDialogWithTriggerInternal extends React.PureComponent {
431
430
  isSharing: isSharing,
432
431
  onSubmit: this.handleShareSubmit,
433
432
  title: shareFormTitle,
434
- showTitle: integrationMode !== IntegrationMode.Tabs || !shareIntegrations || !shareIntegrations.length,
433
+ showTitle: integrationMode !== 'tabs' || !shareIntegrations || !shareIntegrations.length,
435
434
  helperMessage: shareFormHelperMessage,
436
435
  shareError: shareError,
437
436
  onDismiss: this.handleFormDismiss,
@@ -1,5 +1,5 @@
1
- import _extends from "@babel/runtime/helpers/extends";
2
1
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
+ import _extends from "@babel/runtime/helpers/extends";
3
3
  import Button from '@atlaskit/button/custom-theme-button';
4
4
  import Form from '@atlaskit/form';
5
5
  import ErrorIcon from '@atlaskit/icon/glyph/error';
@@ -16,7 +16,6 @@ import CopyLinkButton from './CopyLinkButton';
16
16
  import { ShareHeader } from './ShareHeader';
17
17
  import { UserPickerField } from './UserPickerField';
18
18
  import { IntegrationForm } from './IntegrationForm';
19
- import { IntegrationMode } from '../types/ShareEntities';
20
19
  const SubmitButtonWrapper = styled.div`
21
20
  display: flex;
22
21
  margin-left: auto;
@@ -55,6 +54,12 @@ const IntegrationIconWrapper = styled.span`
55
54
  margin-right: 5px;
56
55
  `;
57
56
 
57
+ const integrationTabText = integrationName => /*#__PURE__*/React.createElement(FormattedMessage, _extends({}, messages.shareInIntegrationButtonText, {
58
+ values: {
59
+ integrationName
60
+ }
61
+ }));
62
+
58
63
  class InternalForm extends React.PureComponent {
59
64
  constructor(...args) {
60
65
  super(...args);
@@ -155,24 +160,24 @@ class InternalForm extends React.PureComponent {
155
160
  render() {
156
161
  const {
157
162
  title,
158
- integrationMode = IntegrationMode.Off,
163
+ integrationMode = 'off',
159
164
  shareIntegrations
160
165
  } = this.props;
161
166
 
162
- if (integrationMode === IntegrationMode.Off || !shareIntegrations || !shareIntegrations.length) {
167
+ if (integrationMode === 'off' || !shareIntegrations || !shareIntegrations.length) {
163
168
  return this.renderShareForm();
164
169
  }
165
170
 
166
171
  const firstIntegration = shareIntegrations[0];
167
172
 
168
- if (integrationMode === IntegrationMode.Tabs) {
173
+ if (integrationMode === 'tabs') {
169
174
  return /*#__PURE__*/React.createElement(Tabs, {
170
175
  id: "ShareForm-Tabs-Integrations"
171
176
  }, /*#__PURE__*/React.createElement(TabList, null, /*#__PURE__*/React.createElement(Tab, {
172
177
  key: `share-tab-default`
173
178
  }, title || /*#__PURE__*/React.createElement(FormattedMessage, messages.formTitle)), /*#__PURE__*/React.createElement(Tab, {
174
179
  key: `share-tab-${firstIntegration.type}`
175
- }, /*#__PURE__*/React.createElement(IntegrationWrapper, null, /*#__PURE__*/React.createElement(IntegrationIconWrapper, null, /*#__PURE__*/React.createElement(firstIntegration.Icon, null)), firstIntegration.type))), /*#__PURE__*/React.createElement(TabPanel, {
180
+ }, /*#__PURE__*/React.createElement(IntegrationWrapper, null, /*#__PURE__*/React.createElement(IntegrationIconWrapper, null, /*#__PURE__*/React.createElement(firstIntegration.Icon, null)), integrationTabText(firstIntegration.type)))), /*#__PURE__*/React.createElement(TabPanel, {
176
181
  key: `share-tabPanel-default`
177
182
  }, /*#__PURE__*/React.createElement(FormWrapper, {
178
183
  isMainShare: true
@@ -155,5 +155,10 @@ export const messages = defineMessages({
155
155
  id: 'fabric.elements.share.to.integration.button',
156
156
  defaultMessage: 'Share to {integrationName}',
157
157
  description: 'Text for the button that allows the user to share the currently viewed item through a 3rd party app like Slack'
158
+ },
159
+ shareInIntegrationButtonText: {
160
+ id: 'fabric.elements.share.in.integration.button',
161
+ defaultMessage: 'Share in {integrationName}',
162
+ description: 'Text for the button that allows the user to share the currently viewed item through a 3rd party app like Slack'
158
163
  }
159
164
  });
@@ -1,8 +1 @@
1
- // Third party integrations
2
- export let IntegrationMode;
3
-
4
- (function (IntegrationMode) {
5
- IntegrationMode[IntegrationMode["Tabs"] = 0] = "Tabs";
6
- IntegrationMode[IntegrationMode["Split"] = 1] = "Split";
7
- IntegrationMode[IntegrationMode["Off"] = 2] = "Off";
8
- })(IntegrationMode || (IntegrationMode = {}));
1
+ export {};
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "name": "@atlaskit/share",
3
- "version": "0.34.2"
3
+ "version": "0.34.3"
4
4
  }
@@ -36,7 +36,6 @@ import { ShareForm } from './ShareForm';
36
36
  import { generateSelectZIndex } from './utils';
37
37
  import { InlineDialogContentWrapper } from './styles';
38
38
  import { IntegrationForm } from './IntegrationForm';
39
- import { IntegrationMode } from '../types/ShareEntities';
40
39
  var ShareButtonWrapper = styled.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: inline-flex;\n outline: none;\n"])));
41
40
  var InlineDialogFormWrapper = styled.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n width: 352px;\n"])));
42
41
  var BottomMessageWrapper = styled.div(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n width: 352px;\n"])));
@@ -340,7 +339,7 @@ export var ShareDialogWithTriggerInternal = /*#__PURE__*/function (_React$PureCo
340
339
  } // If there are any integrations, wrap the share button in a split button with integrations.
341
340
 
342
341
 
343
- if (integrationMode === IntegrationMode.Split && shareIntegrations !== null && shareIntegrations !== void 0 && shareIntegrations.length) {
342
+ if (integrationMode === 'split' && shareIntegrations !== null && shareIntegrations !== void 0 && shareIntegrations.length) {
344
343
  button = /*#__PURE__*/React.createElement(SplitButton, {
345
344
  shareButton: button,
346
345
  handleOpenSplitButton: _this.handleOpenSplitButton,
@@ -451,7 +450,7 @@ export var ShareDialogWithTriggerInternal = /*#__PURE__*/function (_React$PureCo
451
450
  isSharing: isSharing,
452
451
  onSubmit: _this2.handleShareSubmit,
453
452
  title: shareFormTitle,
454
- showTitle: integrationMode !== IntegrationMode.Tabs || !shareIntegrations || !shareIntegrations.length,
453
+ showTitle: integrationMode !== 'tabs' || !shareIntegrations || !shareIntegrations.length,
455
454
  helperMessage: shareFormHelperMessage,
456
455
  shareError: shareError,
457
456
  onDismiss: _this2.handleFormDismiss,
@@ -1,4 +1,3 @@
1
- import _extends from "@babel/runtime/helpers/extends";
2
1
  import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
3
2
  import _createClass from "@babel/runtime/helpers/createClass";
4
3
  import _assertThisInitialized from "@babel/runtime/helpers/assertThisInitialized";
@@ -6,6 +5,7 @@ import _inherits from "@babel/runtime/helpers/inherits";
6
5
  import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
7
6
  import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
8
7
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
8
+ import _extends from "@babel/runtime/helpers/extends";
9
9
  import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
10
10
 
11
11
  var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7;
@@ -30,7 +30,6 @@ import CopyLinkButton from './CopyLinkButton';
30
30
  import { ShareHeader } from './ShareHeader';
31
31
  import { UserPickerField } from './UserPickerField';
32
32
  import { IntegrationForm } from './IntegrationForm';
33
- import { IntegrationMode } from '../types/ShareEntities';
34
33
  var SubmitButtonWrapper = styled.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n margin-left: auto;\n"])));
35
34
  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"])));
36
35
  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) {
@@ -41,6 +40,14 @@ var FormField = styled.div(_templateObject5 || (_templateObject5 = _taggedTempla
41
40
  var IntegrationWrapper = styled.div(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n display: flex;\n align-items: center;\n"])));
42
41
  var IntegrationIconWrapper = styled.span(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n margin-right: 5px;\n"])));
43
42
 
43
+ var integrationTabText = function integrationTabText(integrationName) {
44
+ return /*#__PURE__*/React.createElement(FormattedMessage, _extends({}, messages.shareInIntegrationButtonText, {
45
+ values: {
46
+ integrationName: integrationName
47
+ }
48
+ }));
49
+ };
50
+
44
51
  var InternalForm = /*#__PURE__*/function (_React$PureComponent) {
45
52
  _inherits(InternalForm, _React$PureComponent);
46
53
 
@@ -155,23 +162,23 @@ var InternalForm = /*#__PURE__*/function (_React$PureComponent) {
155
162
  var _this$props4 = this.props,
156
163
  title = _this$props4.title,
157
164
  _this$props4$integrat = _this$props4.integrationMode,
158
- integrationMode = _this$props4$integrat === void 0 ? IntegrationMode.Off : _this$props4$integrat,
165
+ integrationMode = _this$props4$integrat === void 0 ? 'off' : _this$props4$integrat,
159
166
  shareIntegrations = _this$props4.shareIntegrations;
160
167
 
161
- if (integrationMode === IntegrationMode.Off || !shareIntegrations || !shareIntegrations.length) {
168
+ if (integrationMode === 'off' || !shareIntegrations || !shareIntegrations.length) {
162
169
  return this.renderShareForm();
163
170
  }
164
171
 
165
172
  var firstIntegration = shareIntegrations[0];
166
173
 
167
- if (integrationMode === IntegrationMode.Tabs) {
174
+ if (integrationMode === 'tabs') {
168
175
  return /*#__PURE__*/React.createElement(Tabs, {
169
176
  id: "ShareForm-Tabs-Integrations"
170
177
  }, /*#__PURE__*/React.createElement(TabList, null, /*#__PURE__*/React.createElement(Tab, {
171
178
  key: "share-tab-default"
172
179
  }, title || /*#__PURE__*/React.createElement(FormattedMessage, messages.formTitle)), /*#__PURE__*/React.createElement(Tab, {
173
180
  key: "share-tab-".concat(firstIntegration.type)
174
- }, /*#__PURE__*/React.createElement(IntegrationWrapper, null, /*#__PURE__*/React.createElement(IntegrationIconWrapper, null, /*#__PURE__*/React.createElement(firstIntegration.Icon, null)), firstIntegration.type))), /*#__PURE__*/React.createElement(TabPanel, {
181
+ }, /*#__PURE__*/React.createElement(IntegrationWrapper, null, /*#__PURE__*/React.createElement(IntegrationIconWrapper, null, /*#__PURE__*/React.createElement(firstIntegration.Icon, null)), integrationTabText(firstIntegration.type)))), /*#__PURE__*/React.createElement(TabPanel, {
175
182
  key: "share-tabPanel-default"
176
183
  }, /*#__PURE__*/React.createElement(FormWrapper, {
177
184
  isMainShare: true
package/dist/esm/i18n.js CHANGED
@@ -155,5 +155,10 @@ export var messages = defineMessages({
155
155
  id: 'fabric.elements.share.to.integration.button',
156
156
  defaultMessage: 'Share to {integrationName}',
157
157
  description: 'Text for the button that allows the user to share the currently viewed item through a 3rd party app like Slack'
158
+ },
159
+ shareInIntegrationButtonText: {
160
+ id: 'fabric.elements.share.in.integration.button',
161
+ defaultMessage: 'Share in {integrationName}',
162
+ description: 'Text for the button that allows the user to share the currently viewed item through a 3rd party app like Slack'
158
163
  }
159
164
  });
@@ -1,8 +1 @@
1
- // Third party integrations
2
- export var IntegrationMode;
3
-
4
- (function (IntegrationMode) {
5
- IntegrationMode[IntegrationMode["Tabs"] = 0] = "Tabs";
6
- IntegrationMode[IntegrationMode["Split"] = 1] = "Split";
7
- IntegrationMode[IntegrationMode["Off"] = 2] = "Off";
8
- })(IntegrationMode || (IntegrationMode = {}));
1
+ export {};
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "name": "@atlaskit/share",
3
- "version": "0.34.2"
3
+ "version": "0.34.3"
4
4
  }
@@ -154,4 +154,9 @@ export declare const messages: {
154
154
  defaultMessage: string;
155
155
  description: string;
156
156
  };
157
+ shareInIntegrationButtonText: {
158
+ id: string;
159
+ defaultMessage: string;
160
+ description: string;
161
+ };
157
162
  };
@@ -22,8 +22,4 @@ export declare type Integration = {
22
22
  Icon: React.ComponentType;
23
23
  Content: React.ComponentType<IntegrationContentProps>;
24
24
  };
25
- export declare enum IntegrationMode {
26
- Tabs = 0,
27
- Split = 1,
28
- Off = 2
29
- }
25
+ export declare type IntegrationMode = 'tabs' | 'split' | 'off';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/share",
3
- "version": "0.34.2",
3
+ "version": "0.34.3",
4
4
  "description": "Fabric Share Element",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"