@atlaskit/share 1.0.3 → 3.0.1
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 +25 -0
- package/clients/package.json +7 -0
- package/dist/cjs/clients/ShareServiceClient.js +1 -7
- package/dist/cjs/clients/index.js +13 -0
- package/dist/cjs/components/CommentField.js +5 -4
- package/dist/cjs/components/CopyLinkButton.js +22 -17
- package/dist/cjs/components/ErrorBoundary.js +2 -0
- package/dist/cjs/components/IntegrationForm.js +11 -3
- package/dist/cjs/components/LazyShareForm/LazyShareForm.js +105 -0
- package/dist/cjs/components/LazyShareForm/index.js +15 -0
- package/dist/cjs/components/LazyShareForm/lazy.js +53 -0
- package/dist/cjs/components/LazyShareForm/styled.js +28 -0
- package/dist/cjs/components/ShareButton.js +2 -2
- package/dist/cjs/components/ShareDialogContainer.js +9 -8
- package/dist/cjs/components/ShareDialogWithTrigger.js +34 -45
- package/dist/cjs/components/ShareForm.js +31 -12
- package/dist/cjs/components/ShareFormWrapper/ShareFormWrapper.js +29 -0
- package/dist/cjs/components/ShareFormWrapper/index.js +15 -0
- package/dist/cjs/components/ShareFormWrapper/styled.js +31 -0
- package/dist/cjs/components/UserPickerField.js +8 -7
- package/dist/cjs/components/styles.js +1 -20
- package/dist/cjs/components/utils.js +2 -5
- package/dist/cjs/i18n.js +0 -10
- package/dist/cjs/index.js +0 -8
- package/dist/cjs/types/ShareDialogContainer.js +5 -0
- package/dist/cjs/types/ShareEntities.js +10 -1
- package/dist/cjs/types/ShareForm.js +5 -0
- package/dist/cjs/types/index.js +9 -1
- package/dist/cjs/util/i18n-util.js +3 -0
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/clients/ShareServiceClient.js +1 -7
- package/dist/es2019/clients/index.js +1 -0
- package/dist/es2019/components/CommentField.js +3 -2
- package/dist/es2019/components/CopyLinkButton.js +16 -7
- package/dist/es2019/components/ErrorBoundary.js +2 -0
- package/dist/es2019/components/IntegrationForm.js +5 -3
- package/dist/es2019/components/LazyShareForm/LazyShareForm.js +92 -0
- package/dist/es2019/components/LazyShareForm/index.js +1 -0
- package/dist/es2019/components/LazyShareForm/lazy.js +26 -0
- package/dist/es2019/components/LazyShareForm/styled.js +16 -0
- package/dist/es2019/components/MessagesIntlProvider.js +1 -1
- package/dist/es2019/components/ShareButton.js +1 -1
- package/dist/es2019/components/ShareDialogContainer.js +6 -5
- package/dist/es2019/components/ShareDialogWithTrigger.js +33 -42
- package/dist/es2019/components/ShareForm.js +25 -8
- package/dist/es2019/components/ShareFormWrapper/ShareFormWrapper.js +14 -0
- package/dist/es2019/components/ShareFormWrapper/index.js +1 -0
- package/dist/es2019/components/ShareFormWrapper/styled.js +15 -0
- package/dist/es2019/components/UserPickerField.js +5 -4
- package/dist/es2019/components/styles.js +1 -15
- package/dist/es2019/components/utils.js +1 -3
- package/dist/es2019/i18n.js +0 -10
- package/dist/es2019/index.js +0 -1
- package/dist/es2019/types/ShareDialogContainer.js +1 -0
- package/dist/es2019/types/ShareEntities.js +7 -1
- package/dist/es2019/types/ShareForm.js +1 -0
- package/dist/es2019/types/index.js +2 -1
- package/dist/es2019/util/i18n-util.js +3 -0
- package/dist/es2019/version.json +1 -1
- package/dist/esm/clients/ShareServiceClient.js +1 -7
- package/dist/esm/clients/index.js +1 -0
- package/dist/esm/components/CommentField.js +3 -2
- package/dist/esm/components/CopyLinkButton.js +16 -7
- package/dist/esm/components/ErrorBoundary.js +2 -0
- package/dist/esm/components/IntegrationForm.js +11 -3
- package/dist/esm/components/LazyShareForm/LazyShareForm.js +87 -0
- package/dist/esm/components/LazyShareForm/index.js +1 -0
- package/dist/esm/components/LazyShareForm/lazy.js +31 -0
- package/dist/esm/components/LazyShareForm/styled.js +9 -0
- package/dist/esm/components/MessagesIntlProvider.js +1 -1
- package/dist/esm/components/ShareButton.js +1 -1
- package/dist/esm/components/ShareDialogContainer.js +6 -5
- package/dist/esm/components/ShareDialogWithTrigger.js +34 -38
- package/dist/esm/components/ShareForm.js +27 -7
- package/dist/esm/components/ShareFormWrapper/ShareFormWrapper.js +17 -0
- package/dist/esm/components/ShareFormWrapper/index.js +1 -0
- package/dist/esm/components/ShareFormWrapper/styled.js +15 -0
- package/dist/esm/components/UserPickerField.js +5 -4
- package/dist/esm/components/styles.js +1 -16
- package/dist/esm/components/utils.js +1 -3
- package/dist/esm/i18n.js +0 -10
- package/dist/esm/index.js +0 -1
- package/dist/esm/types/ShareDialogContainer.js +1 -0
- package/dist/esm/types/ShareEntities.js +7 -1
- package/dist/esm/types/ShareForm.js +1 -0
- package/dist/esm/types/index.js +2 -1
- package/dist/esm/util/i18n-util.js +3 -0
- package/dist/esm/version.json +1 -1
- package/dist/types/clients/ShareServiceClient.d.ts +2 -2
- package/dist/types/clients/index.d.ts +2 -0
- package/dist/types/components/CopyLinkButton.d.ts +1 -1
- package/dist/types/components/IntegrationForm.d.ts +5 -5
- package/dist/types/components/LazyShareForm/LazyShareForm.d.ts +19 -0
- package/dist/types/components/LazyShareForm/index.d.ts +1 -0
- package/dist/types/components/LazyShareForm/lazy.d.ts +4 -0
- package/dist/types/components/LazyShareForm/styled.d.ts +4 -0
- package/dist/types/components/ShareButton.d.ts +1 -1
- package/dist/types/components/ShareDialogContainer.d.ts +10 -149
- package/dist/types/components/ShareDialogWithTrigger.d.ts +10 -71
- package/dist/types/components/ShareForm.d.ts +5 -43
- package/dist/types/components/ShareFormWrapper/ShareFormWrapper.d.ts +9 -0
- package/dist/types/components/ShareFormWrapper/index.d.ts +1 -0
- package/dist/types/components/ShareFormWrapper/styled.d.ts +9 -0
- package/dist/types/components/UserPickerField.d.ts +1 -1
- package/dist/types/components/styles.d.ts +0 -7
- package/dist/types/i18n.d.ts +0 -10
- package/dist/types/index.d.ts +1 -4
- package/dist/types/types/ShareContentState.d.ts +2 -2
- package/dist/types/types/ShareDialogContainer.d.ts +142 -0
- package/dist/types/types/ShareDialogWithTrigger.d.ts +30 -3
- package/dist/types/types/ShareEntities.d.ts +5 -0
- package/dist/types/types/ShareForm.d.ts +31 -0
- package/dist/types/types/index.d.ts +5 -2
- package/docs/0-intro.tsx +4 -4
- package/package.json +28 -3
|
@@ -27,38 +27,40 @@ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")
|
|
|
27
27
|
|
|
28
28
|
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
29
29
|
|
|
30
|
+
var _react = _interopRequireDefault(require("react"));
|
|
31
|
+
|
|
32
|
+
var _reactIntlNext = require("react-intl-next");
|
|
33
|
+
|
|
34
|
+
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
35
|
+
|
|
30
36
|
var _customThemeButton = _interopRequireDefault(require("@atlaskit/button/custom-theme-button"));
|
|
31
37
|
|
|
32
38
|
var _form = _interopRequireDefault(require("@atlaskit/form"));
|
|
33
39
|
|
|
34
40
|
var _error = _interopRequireDefault(require("@atlaskit/icon/glyph/error"));
|
|
35
41
|
|
|
42
|
+
var _tabs = _interopRequireWildcard(require("@atlaskit/tabs"));
|
|
43
|
+
|
|
36
44
|
var _colors = require("@atlaskit/theme/colors");
|
|
37
45
|
|
|
38
46
|
var _constants = require("@atlaskit/theme/constants");
|
|
39
47
|
|
|
40
48
|
var _tooltip = _interopRequireDefault(require("@atlaskit/tooltip"));
|
|
41
49
|
|
|
42
|
-
var _tabs = _interopRequireWildcard(require("@atlaskit/tabs"));
|
|
43
|
-
|
|
44
|
-
var _react = _interopRequireDefault(require("react"));
|
|
45
|
-
|
|
46
|
-
var _reactIntlNext = require("react-intl-next");
|
|
47
|
-
|
|
48
|
-
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
49
|
-
|
|
50
50
|
var _i18n = require("../i18n");
|
|
51
51
|
|
|
52
|
+
var _types = require("../types");
|
|
53
|
+
|
|
52
54
|
var _CommentField = require("./CommentField");
|
|
53
55
|
|
|
54
56
|
var _CopyLinkButton = _interopRequireDefault(require("./CopyLinkButton"));
|
|
55
57
|
|
|
58
|
+
var _IntegrationForm = require("./IntegrationForm");
|
|
59
|
+
|
|
56
60
|
var _ShareHeader = require("./ShareHeader");
|
|
57
61
|
|
|
58
62
|
var _UserPickerField = require("./UserPickerField");
|
|
59
63
|
|
|
60
|
-
var _IntegrationForm = require("./IntegrationForm");
|
|
61
|
-
|
|
62
64
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7;
|
|
63
65
|
|
|
64
66
|
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); }
|
|
@@ -101,6 +103,7 @@ var integrationTabText = function integrationTabText(integrationName) {
|
|
|
101
103
|
}));
|
|
102
104
|
};
|
|
103
105
|
|
|
106
|
+
// eslint-disable-next-line @repo/internal/react/no-class-components
|
|
104
107
|
var InternalForm = /*#__PURE__*/function (_React$PureComponent) {
|
|
105
108
|
(0, _inherits2.default)(InternalForm, _React$PureComponent);
|
|
106
109
|
|
|
@@ -116,6 +119,9 @@ var InternalForm = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
116
119
|
}
|
|
117
120
|
|
|
118
121
|
_this = _super.call.apply(_super, [this].concat(args));
|
|
122
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "state", {
|
|
123
|
+
selectedTab: _types.TabType.default
|
|
124
|
+
});
|
|
119
125
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "renderShareForm", function () {
|
|
120
126
|
var _this$props = _this.props,
|
|
121
127
|
formProps = _this$props.formProps,
|
|
@@ -149,7 +155,7 @@ var InternalForm = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
149
155
|
defaultValue: defaultValue && defaultValue.users,
|
|
150
156
|
config: config,
|
|
151
157
|
isLoading: isFetchingConfig,
|
|
152
|
-
product: product,
|
|
158
|
+
product: product || 'confluence',
|
|
153
159
|
enableSmartUserPicker: enableSmartUserPicker,
|
|
154
160
|
loggedInAccountId: loggedInAccountId,
|
|
155
161
|
cloudId: cloudId,
|
|
@@ -208,6 +214,11 @@ var InternalForm = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
208
214
|
var productShareType = product === 'jira' ? _objectSpread({}, _i18n.messages.shareMainTabTextJira) : _objectSpread({}, _i18n.messages.shareMainTabTextConfluence);
|
|
209
215
|
return /*#__PURE__*/_react.default.createElement(_reactIntlNext.FormattedMessage, productShareType);
|
|
210
216
|
});
|
|
217
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "changeTab", function (tab) {
|
|
218
|
+
_this.setState({
|
|
219
|
+
selectedTab: tab
|
|
220
|
+
});
|
|
221
|
+
});
|
|
211
222
|
return _this;
|
|
212
223
|
}
|
|
213
224
|
|
|
@@ -225,6 +236,8 @@ var InternalForm = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
225
236
|
}, {
|
|
226
237
|
key: "render",
|
|
227
238
|
value: function render() {
|
|
239
|
+
var _this2 = this;
|
|
240
|
+
|
|
228
241
|
var _this$props5 = this.props,
|
|
229
242
|
_this$props5$integrat = _this$props5.integrationMode,
|
|
230
243
|
integrationMode = _this$props5$integrat === void 0 ? 'off' : _this$props5$integrat,
|
|
@@ -242,8 +255,11 @@ var InternalForm = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
242
255
|
return /*#__PURE__*/_react.default.createElement(_tabs.default, {
|
|
243
256
|
id: "ShareForm-Tabs-Integrations",
|
|
244
257
|
onChange: function onChange(index) {
|
|
258
|
+
_this2.changeTab(index);
|
|
259
|
+
|
|
245
260
|
onTabChange === null || onTabChange === void 0 ? void 0 : onTabChange(index);
|
|
246
|
-
}
|
|
261
|
+
},
|
|
262
|
+
selected: this.state.selectedTab
|
|
247
263
|
}, /*#__PURE__*/_react.default.createElement(_tabs.TabList, null, /*#__PURE__*/_react.default.createElement(_tabs.Tab, {
|
|
248
264
|
key: "share-tab-default"
|
|
249
265
|
}, this.renderMainTabTitle()), /*#__PURE__*/_react.default.createElement(_tabs.Tab, {
|
|
@@ -260,6 +276,9 @@ var InternalForm = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
260
276
|
Content: firstIntegration.Content,
|
|
261
277
|
onIntegrationClose: function onIntegrationClose() {
|
|
262
278
|
return handleCloseDialog === null || handleCloseDialog === void 0 ? void 0 : handleCloseDialog();
|
|
279
|
+
},
|
|
280
|
+
changeTab: function changeTab(index) {
|
|
281
|
+
_this2.changeTab(index);
|
|
263
282
|
}
|
|
264
283
|
}))));
|
|
265
284
|
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = void 0;
|
|
9
|
+
|
|
10
|
+
var _react = _interopRequireDefault(require("react"));
|
|
11
|
+
|
|
12
|
+
var _ShareHeader = require("../ShareHeader");
|
|
13
|
+
|
|
14
|
+
var _styled = require("./styled");
|
|
15
|
+
|
|
16
|
+
var ShareFormWrapper = function ShareFormWrapper(_ref) {
|
|
17
|
+
var shareFormTitle = _ref.shareFormTitle,
|
|
18
|
+
shouldShowTitle = _ref.shouldShowTitle,
|
|
19
|
+
_ref$children = _ref.children,
|
|
20
|
+
children = _ref$children === void 0 ? null : _ref$children,
|
|
21
|
+
_ref$footer = _ref.footer,
|
|
22
|
+
footer = _ref$footer === void 0 ? null : _ref$footer;
|
|
23
|
+
return /*#__PURE__*/_react.default.createElement(_styled.InlineDialogContentWrapper, null, /*#__PURE__*/_react.default.createElement(_styled.InlineDialogFormWrapper, null, shouldShowTitle && /*#__PURE__*/_react.default.createElement(_ShareHeader.ShareHeader, {
|
|
24
|
+
title: shareFormTitle
|
|
25
|
+
}), children), footer);
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
var _default = ShareFormWrapper;
|
|
29
|
+
exports.default = _default;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
Object.defineProperty(exports, "ShareFormWrapper", {
|
|
9
|
+
enumerable: true,
|
|
10
|
+
get: function get() {
|
|
11
|
+
return _ShareFormWrapper.default;
|
|
12
|
+
}
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
var _ShareFormWrapper = _interopRequireDefault(require("./ShareFormWrapper"));
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.InlineDialogFormWrapper = exports.InlineDialogContentWrapper = void 0;
|
|
9
|
+
|
|
10
|
+
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
11
|
+
|
|
12
|
+
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
13
|
+
|
|
14
|
+
var _constants = require("@atlaskit/theme/constants");
|
|
15
|
+
|
|
16
|
+
var _templateObject, _templateObject2;
|
|
17
|
+
|
|
18
|
+
var InlineDialogFormWrapper = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n width: ", "px;\n"])), (0, _constants.gridSize)() * 44);
|
|
19
|
+
/**
|
|
20
|
+
* Apply the same styling, as previous @atlaskit/inline-dialog had,
|
|
21
|
+
* compared to the @atlaskit/popup we are now using.
|
|
22
|
+
*
|
|
23
|
+
* packages/design-system/inline-dialog/src/InlineDialog/styled.ts:20:3
|
|
24
|
+
*/
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
exports.InlineDialogFormWrapper = InlineDialogFormWrapper;
|
|
28
|
+
|
|
29
|
+
var InlineDialogContentWrapper = _styledComponents.default.div(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n padding: ", "px ", "px;\n"])), (0, _constants.gridSize)() * 2, (0, _constants.gridSize)() * 3);
|
|
30
|
+
|
|
31
|
+
exports.InlineDialogContentWrapper = InlineDialogContentWrapper;
|
|
@@ -25,20 +25,20 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
|
|
|
25
25
|
|
|
26
26
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
27
27
|
|
|
28
|
-
var _form = require("@atlaskit/form");
|
|
29
|
-
|
|
30
|
-
var _userPicker = _interopRequireWildcard(require("@atlaskit/user-picker"));
|
|
31
|
-
|
|
32
28
|
var _react = _interopRequireDefault(require("react"));
|
|
33
29
|
|
|
34
30
|
var _reactIntlNext = require("react-intl-next");
|
|
35
31
|
|
|
36
|
-
var
|
|
32
|
+
var _form = require("@atlaskit/form");
|
|
37
33
|
|
|
38
|
-
var
|
|
34
|
+
var _userPicker = _interopRequireWildcard(require("@atlaskit/user-picker"));
|
|
35
|
+
|
|
36
|
+
var _i18n = require("../i18n");
|
|
39
37
|
|
|
40
38
|
var _styles = require("./styles");
|
|
41
39
|
|
|
40
|
+
var _utils = require("./utils");
|
|
41
|
+
|
|
42
42
|
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); }
|
|
43
43
|
|
|
44
44
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
@@ -105,7 +105,8 @@ var requiredMessagesWithoutEmail = {
|
|
|
105
105
|
var getRequiredMessage = function getRequiredMessage(product, allowEmail) {
|
|
106
106
|
var messages = allowEmail ? requiredMessagesWithEmail : requiredMessagesWithoutEmail;
|
|
107
107
|
return messages[product];
|
|
108
|
-
};
|
|
108
|
+
}; // eslint-disable-next-line @repo/internal/react/no-class-components
|
|
109
|
+
|
|
109
110
|
|
|
110
111
|
var UserPickerFieldComponent = /*#__PURE__*/function (_React$Component) {
|
|
111
112
|
(0, _inherits2.default)(UserPickerFieldComponent, _React$Component);
|
|
@@ -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.MAX_PICKER_HEIGHT =
|
|
8
|
+
exports.default = exports.MAX_PICKER_HEIGHT = void 0;
|
|
9
9
|
|
|
10
10
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
11
11
|
|
|
@@ -13,36 +13,17 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
|
|
|
13
13
|
|
|
14
14
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
15
15
|
|
|
16
|
-
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
17
|
-
|
|
18
16
|
var _react = _interopRequireDefault(require("react"));
|
|
19
17
|
|
|
20
|
-
var _constants = require("@atlaskit/theme/constants");
|
|
21
|
-
|
|
22
18
|
var _customThemeButton = _interopRequireDefault(require("@atlaskit/button/custom-theme-button"));
|
|
23
19
|
|
|
24
|
-
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
25
|
-
|
|
26
|
-
var _templateObject;
|
|
27
|
-
|
|
28
20
|
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; }
|
|
29
21
|
|
|
30
22
|
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) { (0, _defineProperty2.default)(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; }
|
|
31
23
|
|
|
32
24
|
var MAX_PICKER_HEIGHT = 102;
|
|
33
|
-
/**
|
|
34
|
-
* Apply the same styling, as previous @atlaskit/inline-dialog had,
|
|
35
|
-
* compared to the @atlaskit/popup we are now using.
|
|
36
|
-
*
|
|
37
|
-
* packages/design-system/inline-dialog/src/InlineDialog/styled.ts:20:3
|
|
38
|
-
*/
|
|
39
|
-
|
|
40
25
|
exports.MAX_PICKER_HEIGHT = MAX_PICKER_HEIGHT;
|
|
41
26
|
|
|
42
|
-
var InlineDialogContentWrapper = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n padding: ", "px ", "px;\n"])), (0, _constants.gridSize)() * 2, (0, _constants.gridSize)() * 3);
|
|
43
|
-
|
|
44
|
-
exports.InlineDialogContentWrapper = InlineDialogContentWrapper;
|
|
45
|
-
|
|
46
27
|
var StyledButton = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
|
|
47
28
|
return /*#__PURE__*/_react.default.createElement(_customThemeButton.default, (0, _extends2.default)({
|
|
48
29
|
ref: ref
|
|
@@ -5,10 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.zIndexAddition = exports.optionDataToUsers = exports.getMenuPortalTargetCurrentHTML = exports.generateSelectZIndex = exports.allowEmails = void 0;
|
|
7
7
|
|
|
8
|
-
var
|
|
9
|
-
|
|
10
|
-
// AFP-2532 TODO: Fix automatic suppressions below
|
|
11
|
-
// eslint-disable-next-line @atlassian/tangerine/import/entry-points
|
|
8
|
+
var _constants = require("@atlaskit/theme/constants");
|
|
12
9
|
|
|
13
10
|
/**
|
|
14
11
|
* We need to generate correct zIndex, for the PopUp and for the Select inside it.
|
|
@@ -23,7 +20,7 @@ var generateSelectZIndex = function generateSelectZIndex(dialogZIndex) {
|
|
|
23
20
|
// If user provided non-number value for zIndex, ignore and return undefined,
|
|
24
21
|
// which will default to `layers.layer()` inside PopUp
|
|
25
22
|
if (typeof dialogZIndex !== 'number' || !dialogZIndex) {
|
|
26
|
-
return
|
|
23
|
+
return _constants.layers.modal() + zIndexAddition;
|
|
27
24
|
}
|
|
28
25
|
|
|
29
26
|
return dialogZIndex + zIndexAddition;
|
package/dist/cjs/i18n.js
CHANGED
|
@@ -108,11 +108,6 @@ var messages = (0, _reactIntlNext.defineMessages)({
|
|
|
108
108
|
defaultMessage: 'Invite',
|
|
109
109
|
description: 'Button label for when the sharee action is set to "edit".'
|
|
110
110
|
},
|
|
111
|
-
copyLinkButtonIconLabel: {
|
|
112
|
-
id: 'fabric.elements.share.copylink.button.icon.label',
|
|
113
|
-
defaultMessage: 'Copy link icon',
|
|
114
|
-
description: 'Default text for the aria-label of the copy Link icon'
|
|
115
|
-
},
|
|
116
111
|
copyLinkButtonText: {
|
|
117
112
|
id: 'fabric.elements.share.copylink.button.text',
|
|
118
113
|
defaultMessage: 'Copy link',
|
|
@@ -123,11 +118,6 @@ var messages = (0, _reactIntlNext.defineMessages)({
|
|
|
123
118
|
defaultMessage: 'Copy public link',
|
|
124
119
|
description: 'Default text for the Copy Link button when the link is public'
|
|
125
120
|
},
|
|
126
|
-
copiedToClipboardIconLabel: {
|
|
127
|
-
id: 'fabric.elements.share.copied.to.clipboard.icon.label',
|
|
128
|
-
defaultMessage: 'Copy link success icon',
|
|
129
|
-
description: 'Default text for the aria-label of the copied link icon'
|
|
130
|
-
},
|
|
131
121
|
copiedToClipboardMessage: {
|
|
132
122
|
id: 'fabric.elements.share.copied.to.clipboard.message',
|
|
133
123
|
defaultMessage: 'Link copied to clipboard',
|
package/dist/cjs/index.js
CHANGED
|
@@ -21,14 +21,6 @@ Object.defineProperty(exports, "ShareDialogContainer", {
|
|
|
21
21
|
return _ShareDialogContainer.ShareDialogContainer;
|
|
22
22
|
}
|
|
23
23
|
});
|
|
24
|
-
Object.defineProperty(exports, "ShareServiceClient", {
|
|
25
|
-
enumerable: true,
|
|
26
|
-
get: function get() {
|
|
27
|
-
return _ShareServiceClient.ShareServiceClient;
|
|
28
|
-
}
|
|
29
|
-
});
|
|
30
|
-
|
|
31
|
-
var _ShareServiceClient = require("./clients/ShareServiceClient");
|
|
32
24
|
|
|
33
25
|
var _ShareDialogContainer = require("./components/ShareDialogContainer");
|
|
34
26
|
|
|
@@ -2,4 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
|
-
});
|
|
5
|
+
});
|
|
6
|
+
exports.TabType = void 0;
|
|
7
|
+
// Third party integrations
|
|
8
|
+
var TabType;
|
|
9
|
+
exports.TabType = TabType;
|
|
10
|
+
|
|
11
|
+
(function (TabType) {
|
|
12
|
+
TabType[TabType["default"] = 0] = "default";
|
|
13
|
+
TabType[TabType["Slack"] = 1] = "Slack";
|
|
14
|
+
})(TabType || (exports.TabType = TabType = {}));
|
package/dist/cjs/types/index.js
CHANGED
|
@@ -15,5 +15,13 @@ Object.defineProperty(exports, "OBJECT_SHARED", {
|
|
|
15
15
|
return _Flag.OBJECT_SHARED;
|
|
16
16
|
}
|
|
17
17
|
});
|
|
18
|
+
Object.defineProperty(exports, "TabType", {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: function get() {
|
|
21
|
+
return _ShareEntities.TabType;
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
var _Flag = require("./Flag");
|
|
18
26
|
|
|
19
|
-
var
|
|
27
|
+
var _ShareEntities = require("./ShareEntities");
|
|
@@ -7,6 +7,9 @@ exports.getMessagesForLocale = void 0;
|
|
|
7
7
|
|
|
8
8
|
var _index = require("../i18n/index");
|
|
9
9
|
|
|
10
|
+
// Cannot import from `../i18n` because there is `../i18n.tsx` file there.
|
|
11
|
+
|
|
12
|
+
/* eslint-disable @atlassian/tangerine/import/no-dangling-index */
|
|
10
13
|
var localesMessagesMap = {
|
|
11
14
|
cs: _index.cs,
|
|
12
15
|
da: _index.da,
|
package/dist/cjs/version.json
CHANGED
|
@@ -10,13 +10,7 @@ export class ShareServiceClient {
|
|
|
10
10
|
};
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
-
getConfig(cloudId
|
|
14
|
-
if (!enableEmailPermissionCheck) {
|
|
15
|
-
return Promise.resolve({
|
|
16
|
-
disableSharingToEmails: false
|
|
17
|
-
});
|
|
18
|
-
}
|
|
19
|
-
|
|
13
|
+
getConfig(cloudId) {
|
|
20
14
|
const options = {
|
|
21
15
|
path: SHARE_CONFIG_PATH,
|
|
22
16
|
queryParams: {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ShareServiceClient } from './ShareServiceClient';
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { useIntl } from 'react-intl-next'; // eslint-disable-next-line @atlaskit/design-system/no-deprecated-imports
|
|
4
|
+
|
|
2
5
|
import FieldTextArea from '@atlaskit/field-text-area';
|
|
3
6
|
import { Field } from '@atlaskit/form';
|
|
4
|
-
import React from 'react';
|
|
5
|
-
import { useIntl } from 'react-intl-next';
|
|
6
7
|
import { messages } from '../i18n';
|
|
7
8
|
export const CommentField = ({
|
|
8
9
|
defaultValue
|
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { isSafari } from 'react-device-detect';
|
|
5
|
+
import { FormattedMessage, injectIntl } from 'react-intl-next';
|
|
6
|
+
import styled from 'styled-components';
|
|
3
7
|
import CheckCircleIcon from '@atlaskit/icon/glyph/check-circle';
|
|
4
8
|
import LinkFilledIcon from '@atlaskit/icon/glyph/link-filled';
|
|
5
9
|
import Popup from '@atlaskit/popup';
|
|
6
10
|
import { G300 } from '@atlaskit/theme/colors';
|
|
7
11
|
import { layers } from '@atlaskit/theme/constants';
|
|
8
12
|
import Tooltip from '@atlaskit/tooltip';
|
|
9
|
-
import React from 'react';
|
|
10
|
-
import { FormattedMessage, injectIntl } from 'react-intl-next';
|
|
11
|
-
import styled from 'styled-components';
|
|
12
|
-
import Button, { InlineDialogContentWrapper } from './styles';
|
|
13
13
|
import { messages } from '../i18n';
|
|
14
|
+
import { InlineDialogContentWrapper } from './ShareFormWrapper/styled';
|
|
15
|
+
import Button from './styles';
|
|
14
16
|
const Z_INDEX = layers.modal();
|
|
15
17
|
const AUTO_DISMISS_SECONDS = 8;
|
|
16
18
|
export const AUTO_DISMISS_MS = AUTO_DISMISS_SECONDS * 1000;
|
|
@@ -28,10 +30,13 @@ export const HiddenInput = /*#__PURE__*/React.forwardRef( // we need a hidden in
|
|
|
28
30
|
position: 'absolute',
|
|
29
31
|
left: '-9999px'
|
|
30
32
|
},
|
|
33
|
+
tabIndex: -1,
|
|
34
|
+
"aria-hidden": true,
|
|
31
35
|
ref: ref,
|
|
32
36
|
value: props.text,
|
|
33
37
|
readOnly: true
|
|
34
38
|
}));
|
|
39
|
+
// eslint-disable-next-line @repo/internal/react/no-class-components
|
|
35
40
|
export class CopyLinkButton extends React.Component {
|
|
36
41
|
constructor(...args) {
|
|
37
42
|
super(...args);
|
|
@@ -85,10 +90,11 @@ export class CopyLinkButton extends React.Component {
|
|
|
85
90
|
isPublicLink
|
|
86
91
|
} = this.props;
|
|
87
92
|
return /*#__PURE__*/React.createElement(Button, _extends({
|
|
93
|
+
"aria-label": formatMessage(isPublicLink ? messages.copyPublicLinkButtonText : messages.copyLinkButtonText),
|
|
88
94
|
isDisabled: isDisabled,
|
|
89
95
|
appearance: "subtle-link",
|
|
90
96
|
iconBefore: /*#__PURE__*/React.createElement(LinkFilledIcon, {
|
|
91
|
-
label:
|
|
97
|
+
label: "",
|
|
92
98
|
size: "medium"
|
|
93
99
|
}),
|
|
94
100
|
onClick: this.handleClick
|
|
@@ -110,13 +116,16 @@ export class CopyLinkButton extends React.Component {
|
|
|
110
116
|
},
|
|
111
117
|
copyTooltipText
|
|
112
118
|
} = this.props;
|
|
113
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(
|
|
119
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, isSafari && /*#__PURE__*/React.createElement("div", {
|
|
120
|
+
className: "assistive",
|
|
121
|
+
"aria-live": "assertive"
|
|
122
|
+
}, shouldShowCopiedMessage && formatMessage(messages.copiedToClipboardMessage)), /*#__PURE__*/React.createElement(HiddenInput, {
|
|
114
123
|
ref: this.inputRef,
|
|
115
124
|
text: this.props.link
|
|
116
125
|
}), /*#__PURE__*/React.createElement(Popup, {
|
|
117
126
|
zIndex: Z_INDEX,
|
|
118
127
|
content: () => /*#__PURE__*/React.createElement(InlineDialogContentWrapper, null, /*#__PURE__*/React.createElement(MessageContainer, null, /*#__PURE__*/React.createElement(CheckCircleIcon, {
|
|
119
|
-
label:
|
|
128
|
+
label: "",
|
|
120
129
|
primaryColor: G300
|
|
121
130
|
}), /*#__PURE__*/React.createElement(MessageSpan, null, /*#__PURE__*/React.createElement(FormattedMessage, messages.copiedToClipboardMessage)))),
|
|
122
131
|
isOpen: shouldShowCopiedMessage,
|
|
@@ -3,6 +3,8 @@ import React from 'react';
|
|
|
3
3
|
import { withAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
4
4
|
import { CHANNEL_ID, errorEncountered } from './analytics';
|
|
5
5
|
|
|
6
|
+
// ErrorBoundary does not support in functional component
|
|
7
|
+
// eslint-disable-next-line @repo/internal/react/no-class-components
|
|
6
8
|
class ErrorBoundary extends React.Component {
|
|
7
9
|
constructor(...args) {
|
|
8
10
|
super(...args);
|
|
@@ -31,7 +31,9 @@ export const FormWrapper = styled.div`
|
|
|
31
31
|
`;
|
|
32
32
|
export const IntegrationForm = ({
|
|
33
33
|
Content,
|
|
34
|
-
onIntegrationClose
|
|
35
|
-
|
|
36
|
-
|
|
34
|
+
onIntegrationClose = () => undefined,
|
|
35
|
+
changeTab = () => undefined
|
|
36
|
+
}) => /*#__PURE__*/React.createElement(FormWrapper, null, Content && /*#__PURE__*/React.createElement(Content, {
|
|
37
|
+
onClose: onIntegrationClose,
|
|
38
|
+
changeTab: changeTab
|
|
37
39
|
}));
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { AnalyticsContext } from '@atlaskit/analytics-next';
|
|
3
|
+
import { ANALYTICS_SOURCE } from '../analytics';
|
|
4
|
+
import { IntegrationForm } from '../IntegrationForm';
|
|
5
|
+
import { ShareForm } from '../ShareForm';
|
|
6
|
+
import { ShareFormWrapper } from '../ShareFormWrapper';
|
|
7
|
+
import { BottomMessageWrapper, CustomFooterWrapper } from './styled';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* A Share form content which is lazy-loaded.
|
|
11
|
+
* Make sure this component is not exported inside main entry points `src/index.ts`
|
|
12
|
+
*/
|
|
13
|
+
function LazyShareForm(props) {
|
|
14
|
+
const {
|
|
15
|
+
copyLink,
|
|
16
|
+
config,
|
|
17
|
+
isFetchingConfig,
|
|
18
|
+
loadOptions,
|
|
19
|
+
shareFormTitle,
|
|
20
|
+
shareFormHelperMessage,
|
|
21
|
+
bottomMessage,
|
|
22
|
+
submitButtonLabel,
|
|
23
|
+
product,
|
|
24
|
+
customFooter,
|
|
25
|
+
enableSmartUserPicker,
|
|
26
|
+
loggedInAccountId,
|
|
27
|
+
cloudId,
|
|
28
|
+
shareFieldsFooter,
|
|
29
|
+
onUserSelectionChange,
|
|
30
|
+
isPublicLink,
|
|
31
|
+
copyTooltipText,
|
|
32
|
+
shareIntegrations,
|
|
33
|
+
integrationMode,
|
|
34
|
+
// actions
|
|
35
|
+
onLinkCopy,
|
|
36
|
+
onDismiss,
|
|
37
|
+
onSubmit,
|
|
38
|
+
onDialogClose,
|
|
39
|
+
// ref
|
|
40
|
+
selectPortalRef,
|
|
41
|
+
// props from states of parent:
|
|
42
|
+
showIntegrationForm,
|
|
43
|
+
selectedIntegration,
|
|
44
|
+
isSharing,
|
|
45
|
+
shareError,
|
|
46
|
+
defaultValue,
|
|
47
|
+
showTitle
|
|
48
|
+
} = props;
|
|
49
|
+
const footer = /*#__PURE__*/React.createElement("div", null, bottomMessage ? /*#__PURE__*/React.createElement(BottomMessageWrapper, null, bottomMessage) : null, customFooter && /*#__PURE__*/React.createElement(CustomFooterWrapper, null, customFooter));
|
|
50
|
+
return /*#__PURE__*/React.createElement(AnalyticsContext, {
|
|
51
|
+
data: {
|
|
52
|
+
source: ANALYTICS_SOURCE
|
|
53
|
+
}
|
|
54
|
+
}, /*#__PURE__*/React.createElement(ShareFormWrapper, {
|
|
55
|
+
footer: footer // form title will be determined by `title` and `showTitle` prop passed to `ShareForm`,
|
|
56
|
+
// so we don't need to show title via ShareFormWrapper
|
|
57
|
+
,
|
|
58
|
+
shouldShowTitle: false
|
|
59
|
+
}, showIntegrationForm && selectedIntegration !== null ? /*#__PURE__*/React.createElement(IntegrationForm, {
|
|
60
|
+
Content: selectedIntegration.Content,
|
|
61
|
+
onIntegrationClose: onDialogClose
|
|
62
|
+
}) : /*#__PURE__*/React.createElement(ShareForm, {
|
|
63
|
+
copyLink: copyLink,
|
|
64
|
+
loadOptions: loadOptions,
|
|
65
|
+
title: shareFormTitle,
|
|
66
|
+
showTitle: showTitle,
|
|
67
|
+
helperMessage: shareFormHelperMessage,
|
|
68
|
+
shareError: shareError,
|
|
69
|
+
defaultValue: defaultValue,
|
|
70
|
+
config: config,
|
|
71
|
+
submitButtonLabel: submitButtonLabel,
|
|
72
|
+
product: product,
|
|
73
|
+
enableSmartUserPicker: enableSmartUserPicker,
|
|
74
|
+
loggedInAccountId: loggedInAccountId,
|
|
75
|
+
cloudId: cloudId,
|
|
76
|
+
fieldsFooter: shareFieldsFooter,
|
|
77
|
+
selectPortalRef: selectPortalRef,
|
|
78
|
+
copyTooltipText: copyTooltipText,
|
|
79
|
+
integrationMode: integrationMode,
|
|
80
|
+
shareIntegrations: shareIntegrations,
|
|
81
|
+
isSharing: isSharing,
|
|
82
|
+
isFetchingConfig: isFetchingConfig,
|
|
83
|
+
isPublicLink: isPublicLink,
|
|
84
|
+
onSubmit: onSubmit,
|
|
85
|
+
onDismiss: onDismiss,
|
|
86
|
+
onLinkCopy: onLinkCopy,
|
|
87
|
+
onUserSelectionChange: onUserSelectionChange,
|
|
88
|
+
handleCloseDialog: onDialogClose
|
|
89
|
+
})));
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
export default LazyShareForm;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './LazyShareForm';
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { lazyForPaint, LazySuspense } from 'react-loosely-lazy';
|
|
3
|
+
import Spinner from '@atlaskit/spinner';
|
|
4
|
+
import { ShareFormWrapper } from '../ShareFormWrapper';
|
|
5
|
+
import { SpinnerWrapper } from './styled';
|
|
6
|
+
const LazyShareFormLazy = lazyForPaint(() => import(
|
|
7
|
+
/* webpackChunkName: "@atlaskit-internal_share-form" */
|
|
8
|
+
'./LazyShareForm'), {
|
|
9
|
+
ssr: false
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
const LoadingDialog = ({
|
|
13
|
+
shareFormTitle,
|
|
14
|
+
showTitle
|
|
15
|
+
}) => /*#__PURE__*/React.createElement(ShareFormWrapper, {
|
|
16
|
+
shareFormTitle: shareFormTitle // if `showTitle` is passed, we use it. Otherwise, we will show title for loading dialog.
|
|
17
|
+
,
|
|
18
|
+
shouldShowTitle: typeof showTitle === 'boolean' ? showTitle : true
|
|
19
|
+
}, /*#__PURE__*/React.createElement(SpinnerWrapper, null, /*#__PURE__*/React.createElement(Spinner, null)));
|
|
20
|
+
|
|
21
|
+
export default (props => /*#__PURE__*/React.createElement(LazySuspense, {
|
|
22
|
+
fallback: /*#__PURE__*/React.createElement(LoadingDialog, {
|
|
23
|
+
shareFormTitle: props.shareFormTitle,
|
|
24
|
+
showTitle: props.showTitle
|
|
25
|
+
})
|
|
26
|
+
}, /*#__PURE__*/React.createElement(LazyShareFormLazy, props)));
|