@atlaskit/share 3.0.3 → 3.0.7

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 (46) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/dist/cjs/clients/ShareServiceClient.js +2 -2
  3. package/dist/cjs/components/IntegrationButton.js +3 -1
  4. package/dist/cjs/components/LazyShareForm/LazyShareForm.js +9 -9
  5. package/dist/cjs/components/MessagesIntlProvider.js +2 -2
  6. package/dist/cjs/components/ShareButton.js +3 -1
  7. package/dist/cjs/components/ShareDialogContainer.js +2 -2
  8. package/dist/cjs/components/ShareDialogWithTrigger.js +11 -5
  9. package/dist/cjs/components/ShareForm.js +41 -36
  10. package/dist/cjs/components/SplitButton.js +3 -1
  11. package/dist/cjs/components/analytics.js +3 -3
  12. package/dist/cjs/components/colorSlackIcon.js +67 -0
  13. package/dist/cjs/components/styles.js +5 -3
  14. package/dist/cjs/components/utils.js +10 -2
  15. package/dist/cjs/i18n.js +10 -0
  16. package/dist/cjs/version.json +1 -1
  17. package/dist/es2019/components/LazyShareForm/LazyShareForm.js +10 -10
  18. package/dist/es2019/components/ShareDialogWithTrigger.js +9 -4
  19. package/dist/es2019/components/ShareForm.js +28 -20
  20. package/dist/es2019/components/analytics.js +1 -1
  21. package/dist/es2019/components/colorSlackIcon.js +57 -0
  22. package/dist/es2019/components/utils.js +6 -1
  23. package/dist/es2019/i18n.js +10 -0
  24. package/dist/es2019/version.json +1 -1
  25. package/dist/esm/clients/ShareServiceClient.js +2 -2
  26. package/dist/esm/components/IntegrationButton.js +2 -1
  27. package/dist/esm/components/LazyShareForm/LazyShareForm.js +10 -10
  28. package/dist/esm/components/MessagesIntlProvider.js +2 -2
  29. package/dist/esm/components/ShareButton.js +2 -1
  30. package/dist/esm/components/ShareDialogContainer.js +2 -2
  31. package/dist/esm/components/ShareDialogWithTrigger.js +12 -6
  32. package/dist/esm/components/ShareForm.js +39 -36
  33. package/dist/esm/components/SplitButton.js +2 -1
  34. package/dist/esm/components/analytics.js +3 -3
  35. package/dist/esm/components/colorSlackIcon.js +57 -0
  36. package/dist/esm/components/styles.js +4 -3
  37. package/dist/esm/components/utils.js +5 -0
  38. package/dist/esm/i18n.js +10 -0
  39. package/dist/esm/version.json +1 -1
  40. package/dist/types/components/ShareForm.d.ts +1 -5
  41. package/dist/types/components/analytics.d.ts +1 -1
  42. package/dist/types/components/colorSlackIcon.d.ts +3 -0
  43. package/dist/types/components/utils.d.ts +2 -0
  44. package/dist/types/i18n.d.ts +10 -0
  45. package/dist/types/types/ShareDialogWithTrigger.d.ts +1 -0
  46. package/package.json +7 -7
@@ -10,9 +10,9 @@ import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral
10
10
 
11
11
  var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7;
12
12
 
13
- 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; }
13
+ 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; }
14
14
 
15
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
15
+ 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; }
16
16
 
17
17
  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); }; }
18
18
 
@@ -21,6 +21,7 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
21
21
  import React from 'react';
22
22
  import { FormattedMessage, injectIntl } from 'react-intl-next';
23
23
  import styled from 'styled-components';
24
+ import { AnalyticsContext } from '@atlaskit/analytics-next';
24
25
  import Button from '@atlaskit/button/custom-theme-button';
25
26
  import Form from '@atlaskit/form';
26
27
  import ErrorIcon from '@atlaskit/icon/glyph/error';
@@ -30,6 +31,7 @@ import { gridSize } from '@atlaskit/theme/constants';
30
31
  import Tooltip from '@atlaskit/tooltip';
31
32
  import { messages } from '../i18n';
32
33
  import { TabType } from '../types';
34
+ import { ANALYTICS_SOURCE, INTEGRATION_MODAL_SOURCE } from './analytics';
33
35
  import { CommentField } from './CommentField';
34
36
  import CopyLinkButton from './CopyLinkButton';
35
37
  import { IntegrationForm } from './IntegrationForm';
@@ -37,13 +39,11 @@ import { ShareHeader } from './ShareHeader';
37
39
  import { UserPickerField } from './UserPickerField';
38
40
  var SubmitButtonWrapper = styled.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n margin-left: auto;\n"])));
39
41
  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"])));
40
- export var FormWrapper = styled.div(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n margin-top: ", "px;\n width: 100%;\n\n /* jira has a class override font settings on h1 in gh-custom-field-pickers.css */\n #ghx-modes-tools #ghx-share & h1:first-child {\n margin-top: 0;\n }\n"])), function (props) {
41
- return props.isMainShare ? gridSize() : gridSize() * 2;
42
- });
42
+ 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"])), gridSize());
43
43
  export var FormFooter = styled.div(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n margin-bottom: ", "px;\n display: flex;\n justify-content: flex-start;\n"])), gridSize);
44
44
  var FormField = styled.div(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n margin-bottom: 12px;\n"])));
45
45
  var IntegrationWrapper = styled.div(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n display: flex;\n align-items: center;\n"])));
46
- var IntegrationIconWrapper = styled.span(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n margin-right: 5px;\n"])));
46
+ var IntegrationIconWrapper = styled.span(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n margin-bottom: -6px;\n margin-right: 5px;\n"])));
47
47
 
48
48
  var integrationTabText = function integrationTabText(integrationName) {
49
49
  return /*#__PURE__*/React.createElement(FormattedMessage, _extends({}, messages.shareInIntegrationButtonText, {
@@ -98,7 +98,11 @@ var InternalForm = /*#__PURE__*/function (_React$PureComponent) {
98
98
  isPublicLink = _this$props.isPublicLink,
99
99
  copyTooltipText = _this$props.copyTooltipText,
100
100
  helperMessage = _this$props.helperMessage;
101
- return /*#__PURE__*/React.createElement("form", formProps, showTitle && /*#__PURE__*/React.createElement(ShareHeader, {
101
+ return /*#__PURE__*/React.createElement(AnalyticsContext, {
102
+ data: {
103
+ source: ANALYTICS_SOURCE
104
+ }
105
+ }, /*#__PURE__*/React.createElement("form", formProps, showTitle && /*#__PURE__*/React.createElement(ShareHeader, {
102
106
  title: title
103
107
  }), /*#__PURE__*/React.createElement(FormField, null, /*#__PURE__*/React.createElement(UserPickerField, {
104
108
  onInputChange: onUserInputChange,
@@ -122,7 +126,7 @@ var InternalForm = /*#__PURE__*/function (_React$PureComponent) {
122
126
  link: copyLink,
123
127
  isPublicLink: isPublicLink,
124
128
  copyTooltipText: copyTooltipText
125
- }), _this.renderSubmitButton()));
129
+ }), _this.renderSubmitButton())));
126
130
  });
127
131
 
128
132
  _defineProperty(_assertThisInitialized(_this), "renderSubmitButton", function () {
@@ -132,10 +136,14 @@ var InternalForm = /*#__PURE__*/function (_React$PureComponent) {
132
136
  shareError = _this$props2.shareError,
133
137
  submitButtonLabel = _this$props2.submitButtonLabel,
134
138
  isDisabled = _this$props2.isDisabled,
135
- isPublicLink = _this$props2.isPublicLink;
139
+ isPublicLink = _this$props2.isPublicLink,
140
+ integrationMode = _this$props2.integrationMode;
136
141
  var shouldShowWarning = shareError && !isSharing;
137
142
  var buttonAppearance = !shouldShowWarning ? 'primary' : 'warning';
138
- var sendLabel = isPublicLink ? messages.formSendPublic : messages.formSend;
143
+ var tabMode = integrationMode === 'tabs';
144
+ var formPublicLabel = tabMode ? messages.formSharePublic : messages.formSendPublic;
145
+ var formSendLabel = tabMode ? messages.formShare : messages.formSend;
146
+ var sendLabel = isPublicLink ? formPublicLabel : formSendLabel;
139
147
  var buttonLabel = shareError ? messages.formRetry : sendLabel;
140
148
  var ButtonLabelWrapper = buttonAppearance === 'warning' ? 'strong' : React.Fragment;
141
149
  return /*#__PURE__*/React.createElement(SubmitButtonWrapper, null, /*#__PURE__*/React.createElement(CenterAlignedIconWrapper, null, shouldShowWarning && /*#__PURE__*/React.createElement(Tooltip, {
@@ -170,9 +178,13 @@ var InternalForm = /*#__PURE__*/function (_React$PureComponent) {
170
178
  });
171
179
 
172
180
  _defineProperty(_assertThisInitialized(_this), "changeTab", function (tab) {
181
+ var _this$props$onTabChan, _this$props4;
182
+
173
183
  _this.setState({
174
184
  selectedTab: tab
175
185
  });
186
+
187
+ (_this$props$onTabChan = (_this$props4 = _this.props).onTabChange) === null || _this$props$onTabChan === void 0 ? void 0 : _this$props$onTabChan.call(_this$props4, tab);
176
188
  });
177
189
 
178
190
  return _this;
@@ -181,9 +193,9 @@ var InternalForm = /*#__PURE__*/function (_React$PureComponent) {
181
193
  _createClass(InternalForm, [{
182
194
  key: "componentWillUnmount",
183
195
  value: function componentWillUnmount() {
184
- var _this$props4 = this.props,
185
- onDismiss = _this$props4.onDismiss,
186
- getValues = _this$props4.getValues;
196
+ var _this$props5 = this.props,
197
+ onDismiss = _this$props5.onDismiss,
198
+ getValues = _this$props5.getValues;
187
199
 
188
200
  if (onDismiss) {
189
201
  onDismiss(getValues());
@@ -192,14 +204,11 @@ var InternalForm = /*#__PURE__*/function (_React$PureComponent) {
192
204
  }, {
193
205
  key: "render",
194
206
  value: function render() {
195
- var _this2 = this;
196
-
197
- var _this$props5 = this.props,
198
- _this$props5$integrat = _this$props5.integrationMode,
199
- integrationMode = _this$props5$integrat === void 0 ? 'off' : _this$props5$integrat,
200
- shareIntegrations = _this$props5.shareIntegrations,
201
- onTabChange = _this$props5.onTabChange,
202
- handleCloseDialog = _this$props5.handleCloseDialog;
207
+ var _this$props6 = this.props,
208
+ _this$props6$integrat = _this$props6.integrationMode,
209
+ integrationMode = _this$props6$integrat === void 0 ? 'off' : _this$props6$integrat,
210
+ shareIntegrations = _this$props6.shareIntegrations,
211
+ handleCloseDialog = _this$props6.handleCloseDialog;
203
212
 
204
213
  if (integrationMode === 'off' || !shareIntegrations || !shareIntegrations.length) {
205
214
  return this.renderShareForm();
@@ -210,11 +219,7 @@ var InternalForm = /*#__PURE__*/function (_React$PureComponent) {
210
219
  if (integrationMode === 'tabs') {
211
220
  return /*#__PURE__*/React.createElement(Tabs, {
212
221
  id: "ShareForm-Tabs-Integrations",
213
- onChange: function onChange(index) {
214
- _this2.changeTab(index);
215
-
216
- onTabChange === null || onTabChange === void 0 ? void 0 : onTabChange(index);
217
- },
222
+ onChange: this.changeTab,
218
223
  selected: this.state.selectedTab
219
224
  }, /*#__PURE__*/React.createElement(TabList, null, /*#__PURE__*/React.createElement(Tab, {
220
225
  key: "share-tab-default"
@@ -222,21 +227,19 @@ var InternalForm = /*#__PURE__*/function (_React$PureComponent) {
222
227
  key: "share-tab-".concat(firstIntegration.type)
223
228
  }, /*#__PURE__*/React.createElement(IntegrationWrapper, null, /*#__PURE__*/React.createElement(IntegrationIconWrapper, null, /*#__PURE__*/React.createElement(firstIntegration.Icon, null)), integrationTabText(firstIntegration.type)))), /*#__PURE__*/React.createElement(TabPanel, {
224
229
  key: "share-tabPanel-default"
225
- }, /*#__PURE__*/React.createElement(FormWrapper, {
226
- isMainShare: true
227
- }, this.renderShareForm())), /*#__PURE__*/React.createElement(TabPanel, {
230
+ }, /*#__PURE__*/React.createElement(FormWrapper, null, this.renderShareForm())), /*#__PURE__*/React.createElement(TabPanel, {
228
231
  key: "share-tabPanel-integration"
229
- }, /*#__PURE__*/React.createElement(FormWrapper, {
230
- isMainShare: false
231
- }, /*#__PURE__*/React.createElement(IntegrationForm, {
232
+ }, /*#__PURE__*/React.createElement(AnalyticsContext, {
233
+ data: {
234
+ source: INTEGRATION_MODAL_SOURCE
235
+ }
236
+ }, /*#__PURE__*/React.createElement(FormWrapper, null, /*#__PURE__*/React.createElement(IntegrationForm, {
232
237
  Content: firstIntegration.Content,
233
238
  onIntegrationClose: function onIntegrationClose() {
234
239
  return handleCloseDialog === null || handleCloseDialog === void 0 ? void 0 : handleCloseDialog();
235
240
  },
236
- changeTab: function changeTab(index) {
237
- _this2.changeTab(index);
238
- }
239
- }))));
241
+ changeTab: this.changeTab
242
+ })))));
240
243
  }
241
244
 
242
245
  return this.renderShareForm();
@@ -1,6 +1,7 @@
1
1
  import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
2
2
  import _extends from "@babel/runtime/helpers/extends";
3
3
  import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
4
+ var _excluded = ["triggerRef"];
4
5
 
5
6
  var _templateObject, _templateObject2, _templateObject3;
6
7
 
@@ -52,7 +53,7 @@ var SplitButtonDropdown = function SplitButtonDropdown(props) {
52
53
  testId: "split-button-dropdown",
53
54
  trigger: function trigger(_ref2) {
54
55
  var triggerRef = _ref2.triggerRef,
55
- providedProps = _objectWithoutProperties(_ref2, ["triggerRef"]);
56
+ providedProps = _objectWithoutProperties(_ref2, _excluded);
56
57
 
57
58
  return /*#__PURE__*/React.createElement(Button, _extends({}, providedProps, {
58
59
  ref: triggerRef,
@@ -1,8 +1,8 @@
1
1
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
2
 
3
- 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; }
3
+ 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; }
4
4
 
5
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
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; }
6
6
 
7
7
  import { isEmail, isTeam, isUser } from '@atlaskit/user-picker';
8
8
  import { name as packageName, version as packageVersion } from '../version.json';
@@ -38,7 +38,7 @@ var createScreenEvent = function createScreenEvent(name) {
38
38
 
39
39
  export var CHANNEL_ID = 'fabric-elements';
40
40
  export var ANALYTICS_SOURCE = 'shareModal';
41
- export var INTEGRATION_MODAL_SOURCE = 'integrationShareModal';
41
+ export var INTEGRATION_MODAL_SOURCE = 'integrationShareDialog';
42
42
  export var screenEvent = function screenEvent(_ref) {
43
43
  var _ref$isPublicLink = _ref.isPublicLink,
44
44
  isPublicLink = _ref$isPublicLink === void 0 ? false : _ref$isPublicLink;
@@ -0,0 +1,57 @@
1
+ import React from 'react';
2
+
3
+ var SlackIcon = function SlackIcon() {
4
+ return /*#__PURE__*/React.createElement("svg", {
5
+ width: "16",
6
+ height: "16",
7
+ viewBox: "0 0 125 125"
8
+ }, /*#__PURE__*/React.createElement("style", null, '.prefix__st0{fill:#e01e5a}.prefix__st1{fill:#36c5f0}.prefix__st2{fill:#2eb67d}.prefix__st3{fill:#ecb22e}'), /*#__PURE__*/React.createElement("path", {
9
+ fill: "none",
10
+ id: "prefix__canvas_background",
11
+ d: "M-1-1h127v127H-1z"
12
+ }), /*#__PURE__*/React.createElement("g", null, /*#__PURE__*/React.createElement("g", {
13
+ id: "prefix__svg_1"
14
+ }, /*#__PURE__*/React.createElement("g", {
15
+ id: "prefix__svg_2"
16
+ }, /*#__PURE__*/React.createElement("path", {
17
+ id: "prefix__svg_3",
18
+ d: "M27.4 79.2c0 7.1-5.8 12.9-12.9 12.9-7.1 0-12.9-5.8-12.9-12.9 0-7.1 5.8-12.9 12.9-12.9h12.9v12.9z",
19
+ className: "prefix__st0"
20
+ }), /*#__PURE__*/React.createElement("path", {
21
+ id: "prefix__svg_4",
22
+ d: "M33.9 79.2c0-7.1 5.8-12.9 12.9-12.9s12.9 5.8 12.9 12.9v32.3c0 7.1-5.8 12.9-12.9 12.9s-12.9-5.8-12.9-12.9V79.2z",
23
+ className: "prefix__st0"
24
+ })), /*#__PURE__*/React.createElement("g", {
25
+ id: "prefix__svg_5"
26
+ }, /*#__PURE__*/React.createElement("path", {
27
+ id: "prefix__svg_6",
28
+ d: "M46.8 27.4c-7.1 0-12.9-5.8-12.9-12.9 0-7.1 5.8-12.9 12.9-12.9s12.9 5.8 12.9 12.9v12.9H46.8z",
29
+ className: "prefix__st1"
30
+ }), /*#__PURE__*/React.createElement("path", {
31
+ id: "prefix__svg_7",
32
+ d: "M46.8 33.9c7.1 0 12.9 5.8 12.9 12.9s-5.8 12.9-12.9 12.9H14.5c-7.1 0-12.9-5.8-12.9-12.9s5.8-12.9 12.9-12.9h32.3z",
33
+ className: "prefix__st1"
34
+ })), /*#__PURE__*/React.createElement("g", {
35
+ id: "prefix__svg_8"
36
+ }, /*#__PURE__*/React.createElement("path", {
37
+ id: "prefix__svg_9",
38
+ d: "M98.6 46.8c0-7.1 5.8-12.9 12.9-12.9 7.1 0 12.9 5.8 12.9 12.9s-5.8 12.9-12.9 12.9H98.6V46.8z",
39
+ className: "prefix__st2"
40
+ }), /*#__PURE__*/React.createElement("path", {
41
+ id: "prefix__svg_10",
42
+ d: "M92.1 46.8c0 7.1-5.8 12.9-12.9 12.9-7.1 0-12.9-5.8-12.9-12.9V14.5c0-7.1 5.8-12.9 12.9-12.9 7.1 0 12.9 5.8 12.9 12.9v32.3z",
43
+ className: "prefix__st2"
44
+ })), /*#__PURE__*/React.createElement("g", {
45
+ id: "prefix__svg_11"
46
+ }, /*#__PURE__*/React.createElement("path", {
47
+ id: "prefix__svg_12",
48
+ d: "M79.2 98.6c7.1 0 12.9 5.8 12.9 12.9 0 7.1-5.8 12.9-12.9 12.9-7.1 0-12.9-5.8-12.9-12.9V98.6h12.9z",
49
+ className: "prefix__st3"
50
+ }), /*#__PURE__*/React.createElement("path", {
51
+ id: "prefix__svg_13",
52
+ d: "M79.2 92.1c-7.1 0-12.9-5.8-12.9-12.9 0-7.1 5.8-12.9 12.9-12.9h32.3c7.1 0 12.9 5.8 12.9 12.9 0 7.1-5.8 12.9-12.9 12.9H79.2z",
53
+ className: "prefix__st3"
54
+ })))));
55
+ };
56
+
57
+ export default SlackIcon;
@@ -1,10 +1,11 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
3
3
  import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
4
+ var _excluded = ["buttonStyles"];
4
5
 
5
- 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; }
6
+ 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
 
7
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
8
+ 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
 
9
10
  import React from 'react';
10
11
  import Button from '@atlaskit/button/custom-theme-button';
@@ -16,7 +17,7 @@ var StyledButton = /*#__PURE__*/React.forwardRef(function (props, ref) {
16
17
  theme: function theme(currentTheme, themeProps) {
17
18
  var _currentTheme = currentTheme(themeProps),
18
19
  buttonStyles = _currentTheme.buttonStyles,
19
- rest = _objectWithoutProperties(_currentTheme, ["buttonStyles"]);
20
+ rest = _objectWithoutProperties(_currentTheme, _excluded);
20
21
 
21
22
  return _objectSpread({
22
23
  buttonStyles: _objectSpread(_objectSpread({}, buttonStyles), {}, {
@@ -53,4 +53,9 @@ export var optionDataToUsers = function optionDataToUsers(optionDataArray) {
53
53
  };
54
54
  export var allowEmails = function allowEmails(config) {
55
55
  return !(config && config.disableSharingToEmails);
56
+ };
57
+ export var resolveShareFooter = function resolveShareFooter(integrationMode, tabIndex, customFooter) {
58
+ if (integrationMode === 'tabs' && tabIndex === 0 && customFooter) {
59
+ return customFooter;
60
+ }
56
61
  };
package/dist/esm/i18n.js CHANGED
@@ -10,11 +10,21 @@ export var messages = defineMessages({
10
10
  defaultMessage: 'Send',
11
11
  description: 'Label for Share form submit button.'
12
12
  },
13
+ formShare: {
14
+ id: 'fabric.elements.share.form.share',
15
+ defaultMessage: 'Share',
16
+ description: 'Label for Share form submit button.'
17
+ },
13
18
  formSendPublic: {
14
19
  id: 'fabric.elements.share.form.public.send',
15
20
  defaultMessage: 'Send public link',
16
21
  description: 'Label for Share form submit button when link is public.'
17
22
  },
23
+ formSharePublic: {
24
+ id: 'fabric.elements.share.form.public.share',
25
+ defaultMessage: 'Share public link',
26
+ description: 'Label for Share form submit button when link is public.'
27
+ },
18
28
  formRetry: {
19
29
  id: 'fabric.elements.share.form.retry',
20
30
  defaultMessage: 'Retry',
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "name": "@atlaskit/share",
3
- "version": "3.0.3"
3
+ "version": "3.0.7"
4
4
  }
@@ -1,14 +1,10 @@
1
1
  import React from 'react';
2
2
  import { WrappedComponentProps } from 'react-intl-next';
3
3
  import { FormChildrenArgs, ShareData, ShareFormProps, TabType } from '../types';
4
- interface FormWrapperType {
5
- isMainShare?: boolean;
6
- }
7
- export declare const FormWrapper: import("styled-components").StyledComponentClass<React.ClassAttributes<HTMLDivElement> & React.HTMLAttributes<HTMLDivElement> & FormWrapperType, any, React.ClassAttributes<HTMLDivElement> & React.HTMLAttributes<HTMLDivElement> & FormWrapperType>;
4
+ export declare const FormWrapper: import("styled-components").StyledComponentClass<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, any, React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>>;
8
5
  export declare const FormFooter: import("styled-components").StyledComponentClass<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, any, React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>>;
9
6
  export declare type State = {
10
7
  selectedTab: TabType;
11
8
  };
12
9
  export declare type InternalFormProps = FormChildrenArgs<ShareData> & ShareFormProps & WrappedComponentProps;
13
10
  export declare const ShareForm: React.FC<ShareFormProps>;
14
- export {};
@@ -1,7 +1,7 @@
1
1
  import { DialogContentState, OriginTracing } from '../types';
2
2
  export declare const CHANNEL_ID = "fabric-elements";
3
3
  export declare const ANALYTICS_SOURCE = "shareModal";
4
- export declare const INTEGRATION_MODAL_SOURCE = "integrationShareModal";
4
+ export declare const INTEGRATION_MODAL_SOURCE = "integrationShareDialog";
5
5
  export declare const screenEvent: ({ isPublicLink }: {
6
6
  isPublicLink?: boolean | undefined;
7
7
  }) => Record<string, any>;
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ declare const SlackIcon: () => JSX.Element;
3
+ export default SlackIcon;
@@ -1,6 +1,7 @@
1
1
  /// <reference types="react" />
2
2
  import { OptionData } from '@atlaskit/user-picker';
3
3
  import { ConfigResponse, User } from '../types';
4
+ import type { IntegrationMode } from '../types/ShareEntities';
4
5
  /**
5
6
  * We need to generate correct zIndex, for the PopUp and for the Select inside it.
6
7
  * The PopUp's defaults to `layers.layer()` from @atlaskit/theme. But if user provides
@@ -16,3 +17,4 @@ export declare const generateSelectZIndex: (dialogZIndex?: number | undefined) =
16
17
  export declare const getMenuPortalTargetCurrentHTML: (ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined) => HTMLDivElement | null;
17
18
  export declare const optionDataToUsers: (optionDataArray: OptionData[]) => User[];
18
19
  export declare const allowEmails: (config?: ConfigResponse | undefined) => boolean;
20
+ export declare const resolveShareFooter: (integrationMode: IntegrationMode | undefined, tabIndex: number, customFooter: React.ReactNode) => React.ReactNode | undefined;
@@ -9,11 +9,21 @@ export declare const messages: {
9
9
  defaultMessage: string;
10
10
  description: string;
11
11
  };
12
+ formShare: {
13
+ id: string;
14
+ defaultMessage: string;
15
+ description: string;
16
+ };
12
17
  formSendPublic: {
13
18
  id: string;
14
19
  defaultMessage: string;
15
20
  description: string;
16
21
  };
22
+ formSharePublic: {
23
+ id: string;
24
+ defaultMessage: string;
25
+ description: string;
26
+ };
17
27
  formRetry: {
18
28
  id: string;
19
29
  defaultMessage: string;
@@ -40,4 +40,5 @@ export declare type ShareDialogWithTriggerStates = {
40
40
  isUsingSplitButton: boolean;
41
41
  showIntegrationForm: boolean;
42
42
  selectedIntegration: Integration | null;
43
+ tabIndex: number;
43
44
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/share",
3
- "version": "3.0.3",
3
+ "version": "3.0.7",
4
4
  "description": "Fabric Share Element",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -35,12 +35,12 @@
35
35
  "@atlaskit/dropdown-menu": "^11.0.0",
36
36
  "@atlaskit/field-text-area": "^8.0.0",
37
37
  "@atlaskit/form": "^8.4.0",
38
- "@atlaskit/icon": "^21.9.0",
39
- "@atlaskit/popup": "^1.2.0",
38
+ "@atlaskit/icon": "^21.10.0",
39
+ "@atlaskit/popup": "^1.3.0",
40
40
  "@atlaskit/portal": "^4.0.0",
41
41
  "@atlaskit/spinner": "^15.1.4",
42
42
  "@atlaskit/tabs": "^13.2.3",
43
- "@atlaskit/theme": "^12.0.0",
43
+ "@atlaskit/theme": "^12.1.0",
44
44
  "@atlaskit/tooltip": "^17.5.0",
45
45
  "@atlaskit/user-picker": "^8.3.0",
46
46
  "@atlaskit/util-service-support": "^6.0.0",
@@ -59,11 +59,11 @@
59
59
  "devDependencies": {
60
60
  "@atlaskit/docs": "^9.0.0",
61
61
  "@atlaskit/editor-test-helpers": "^16.0.0",
62
- "@atlaskit/flag": "^14.4.0",
62
+ "@atlaskit/flag": "^14.5.0",
63
63
  "@atlaskit/section-message": "^6.0.0",
64
64
  "@atlaskit/select": "^15.0.0",
65
- "@atlaskit/toggle": "^12.3.0",
66
- "@atlaskit/util-data-test": "^17.0.0",
65
+ "@atlaskit/toggle": "^12.4.0",
66
+ "@atlaskit/util-data-test": "^17.1.0",
67
67
  "@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",
68
68
  "enzyme": "^3.10.0",
69
69
  "enzyme-adapter-react-16": "^1.15.1",