@atlaskit/share 1.0.2 → 1.0.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 +6 -0
- package/dist/cjs/components/ShareForm.js +30 -11
- package/dist/cjs/i18n.js +10 -0
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/components/ShareForm.js +21 -2
- package/dist/es2019/i18n.js +10 -0
- package/dist/es2019/version.json +1 -1
- package/dist/esm/components/ShareForm.js +31 -11
- package/dist/esm/i18n.js +10 -0
- package/dist/esm/version.json +1 -1
- package/dist/types/i18n.d.ts +10 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @atlaskit/share
|
|
2
2
|
|
|
3
|
+
## 1.0.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`6eb7be4e83d`](https://bitbucket.org/atlassian/atlassian-frontend/commits/6eb7be4e83d) - [ux] Implementing the product specific tab share titles for the experiment
|
|
8
|
+
|
|
3
9
|
## 1.0.2
|
|
4
10
|
|
|
5
11
|
### Patch Changes
|
|
@@ -65,6 +65,10 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
65
65
|
|
|
66
66
|
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; }
|
|
67
67
|
|
|
68
|
+
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; }
|
|
69
|
+
|
|
70
|
+
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; }
|
|
71
|
+
|
|
68
72
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
69
73
|
|
|
70
74
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
@@ -188,15 +192,31 @@ var InternalForm = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
188
192
|
isDisabled: isDisabled
|
|
189
193
|
}, /*#__PURE__*/_react.default.createElement(ButtonLabelWrapper, null, submitButtonLabel || /*#__PURE__*/_react.default.createElement(_reactIntlNext.FormattedMessage, buttonLabel))));
|
|
190
194
|
});
|
|
195
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "renderMainTabTitle", function () {
|
|
196
|
+
var _this$props3 = _this.props,
|
|
197
|
+
title = _this$props3.title,
|
|
198
|
+
product = _this$props3.product;
|
|
199
|
+
|
|
200
|
+
if (title) {
|
|
201
|
+
return title;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
if (!product) {
|
|
205
|
+
return /*#__PURE__*/_react.default.createElement(_reactIntlNext.FormattedMessage, _i18n.messages.formTitle);
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
var productShareType = product === 'jira' ? _objectSpread({}, _i18n.messages.shareMainTabTextJira) : _objectSpread({}, _i18n.messages.shareMainTabTextConfluence);
|
|
209
|
+
return /*#__PURE__*/_react.default.createElement(_reactIntlNext.FormattedMessage, productShareType);
|
|
210
|
+
});
|
|
191
211
|
return _this;
|
|
192
212
|
}
|
|
193
213
|
|
|
194
214
|
(0, _createClass2.default)(InternalForm, [{
|
|
195
215
|
key: "componentWillUnmount",
|
|
196
216
|
value: function componentWillUnmount() {
|
|
197
|
-
var _this$
|
|
198
|
-
onDismiss = _this$
|
|
199
|
-
getValues = _this$
|
|
217
|
+
var _this$props4 = this.props,
|
|
218
|
+
onDismiss = _this$props4.onDismiss,
|
|
219
|
+
getValues = _this$props4.getValues;
|
|
200
220
|
|
|
201
221
|
if (onDismiss) {
|
|
202
222
|
onDismiss(getValues());
|
|
@@ -205,13 +225,12 @@ var InternalForm = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
205
225
|
}, {
|
|
206
226
|
key: "render",
|
|
207
227
|
value: function render() {
|
|
208
|
-
var _this$
|
|
209
|
-
|
|
210
|
-
_this$
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
handleCloseDialog = _this$props4.handleCloseDialog;
|
|
228
|
+
var _this$props5 = this.props,
|
|
229
|
+
_this$props5$integrat = _this$props5.integrationMode,
|
|
230
|
+
integrationMode = _this$props5$integrat === void 0 ? 'off' : _this$props5$integrat,
|
|
231
|
+
shareIntegrations = _this$props5.shareIntegrations,
|
|
232
|
+
onTabChange = _this$props5.onTabChange,
|
|
233
|
+
handleCloseDialog = _this$props5.handleCloseDialog;
|
|
215
234
|
|
|
216
235
|
if (integrationMode === 'off' || !shareIntegrations || !shareIntegrations.length) {
|
|
217
236
|
return this.renderShareForm();
|
|
@@ -227,7 +246,7 @@ var InternalForm = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
227
246
|
}
|
|
228
247
|
}, /*#__PURE__*/_react.default.createElement(_tabs.TabList, null, /*#__PURE__*/_react.default.createElement(_tabs.Tab, {
|
|
229
248
|
key: "share-tab-default"
|
|
230
|
-
},
|
|
249
|
+
}, this.renderMainTabTitle()), /*#__PURE__*/_react.default.createElement(_tabs.Tab, {
|
|
231
250
|
key: "share-tab-".concat(firstIntegration.type)
|
|
232
251
|
}, /*#__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, {
|
|
233
252
|
key: "share-tabPanel-default"
|
package/dist/cjs/i18n.js
CHANGED
|
@@ -168,6 +168,16 @@ var messages = (0, _reactIntlNext.defineMessages)({
|
|
|
168
168
|
id: 'fabric.elements.share.in.integration.button',
|
|
169
169
|
defaultMessage: 'Share in {integrationName}',
|
|
170
170
|
description: 'Text for the button that allows the user to share the currently viewed item through a 3rd party app like Slack'
|
|
171
|
+
},
|
|
172
|
+
shareMainTabTextJira: {
|
|
173
|
+
id: 'fabric.elements.share.main.tab.text.jira',
|
|
174
|
+
defaultMessage: 'Share issue',
|
|
175
|
+
description: 'Text for the main share tab for jira'
|
|
176
|
+
},
|
|
177
|
+
shareMainTabTextConfluence: {
|
|
178
|
+
id: 'fabric.elements.share.main.tab.text.confluence',
|
|
179
|
+
defaultMessage: 'Share page',
|
|
180
|
+
description: 'Text for the main share tab for confluence'
|
|
171
181
|
}
|
|
172
182
|
});
|
|
173
183
|
exports.messages = messages;
|
package/dist/cjs/version.json
CHANGED
|
@@ -144,6 +144,26 @@ class InternalForm extends React.PureComponent {
|
|
|
144
144
|
isDisabled: isDisabled
|
|
145
145
|
}, /*#__PURE__*/React.createElement(ButtonLabelWrapper, null, submitButtonLabel || /*#__PURE__*/React.createElement(FormattedMessage, buttonLabel))));
|
|
146
146
|
});
|
|
147
|
+
|
|
148
|
+
_defineProperty(this, "renderMainTabTitle", () => {
|
|
149
|
+
const {
|
|
150
|
+
title,
|
|
151
|
+
product
|
|
152
|
+
} = this.props;
|
|
153
|
+
|
|
154
|
+
if (title) {
|
|
155
|
+
return title;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
if (!product) {
|
|
159
|
+
return /*#__PURE__*/React.createElement(FormattedMessage, messages.formTitle);
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
const productShareType = product === 'jira' ? { ...messages.shareMainTabTextJira
|
|
163
|
+
} : { ...messages.shareMainTabTextConfluence
|
|
164
|
+
};
|
|
165
|
+
return /*#__PURE__*/React.createElement(FormattedMessage, productShareType);
|
|
166
|
+
});
|
|
147
167
|
}
|
|
148
168
|
|
|
149
169
|
componentWillUnmount() {
|
|
@@ -159,7 +179,6 @@ class InternalForm extends React.PureComponent {
|
|
|
159
179
|
|
|
160
180
|
render() {
|
|
161
181
|
const {
|
|
162
|
-
title,
|
|
163
182
|
integrationMode = 'off',
|
|
164
183
|
shareIntegrations,
|
|
165
184
|
onTabChange,
|
|
@@ -180,7 +199,7 @@ class InternalForm extends React.PureComponent {
|
|
|
180
199
|
}
|
|
181
200
|
}, /*#__PURE__*/React.createElement(TabList, null, /*#__PURE__*/React.createElement(Tab, {
|
|
182
201
|
key: `share-tab-default`
|
|
183
|
-
},
|
|
202
|
+
}, this.renderMainTabTitle()), /*#__PURE__*/React.createElement(Tab, {
|
|
184
203
|
key: `share-tab-${firstIntegration.type}`
|
|
185
204
|
}, /*#__PURE__*/React.createElement(IntegrationWrapper, null, /*#__PURE__*/React.createElement(IntegrationIconWrapper, null, /*#__PURE__*/React.createElement(firstIntegration.Icon, null)), integrationTabText(firstIntegration.type)))), /*#__PURE__*/React.createElement(TabPanel, {
|
|
186
205
|
key: `share-tabPanel-default`
|
package/dist/es2019/i18n.js
CHANGED
|
@@ -160,5 +160,15 @@ export const messages = defineMessages({
|
|
|
160
160
|
id: 'fabric.elements.share.in.integration.button',
|
|
161
161
|
defaultMessage: 'Share in {integrationName}',
|
|
162
162
|
description: 'Text for the button that allows the user to share the currently viewed item through a 3rd party app like Slack'
|
|
163
|
+
},
|
|
164
|
+
shareMainTabTextJira: {
|
|
165
|
+
id: 'fabric.elements.share.main.tab.text.jira',
|
|
166
|
+
defaultMessage: 'Share issue',
|
|
167
|
+
description: 'Text for the main share tab for jira'
|
|
168
|
+
},
|
|
169
|
+
shareMainTabTextConfluence: {
|
|
170
|
+
id: 'fabric.elements.share.main.tab.text.confluence',
|
|
171
|
+
defaultMessage: 'Share page',
|
|
172
|
+
description: 'Text for the main share tab for confluence'
|
|
163
173
|
}
|
|
164
174
|
});
|
package/dist/es2019/version.json
CHANGED
|
@@ -10,6 +10,10 @@ 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; }
|
|
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; }
|
|
16
|
+
|
|
13
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); }; }
|
|
14
18
|
|
|
15
19
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
@@ -142,15 +146,32 @@ var InternalForm = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
142
146
|
}, /*#__PURE__*/React.createElement(ButtonLabelWrapper, null, submitButtonLabel || /*#__PURE__*/React.createElement(FormattedMessage, buttonLabel))));
|
|
143
147
|
});
|
|
144
148
|
|
|
149
|
+
_defineProperty(_assertThisInitialized(_this), "renderMainTabTitle", function () {
|
|
150
|
+
var _this$props3 = _this.props,
|
|
151
|
+
title = _this$props3.title,
|
|
152
|
+
product = _this$props3.product;
|
|
153
|
+
|
|
154
|
+
if (title) {
|
|
155
|
+
return title;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
if (!product) {
|
|
159
|
+
return /*#__PURE__*/React.createElement(FormattedMessage, messages.formTitle);
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
var productShareType = product === 'jira' ? _objectSpread({}, messages.shareMainTabTextJira) : _objectSpread({}, messages.shareMainTabTextConfluence);
|
|
163
|
+
return /*#__PURE__*/React.createElement(FormattedMessage, productShareType);
|
|
164
|
+
});
|
|
165
|
+
|
|
145
166
|
return _this;
|
|
146
167
|
}
|
|
147
168
|
|
|
148
169
|
_createClass(InternalForm, [{
|
|
149
170
|
key: "componentWillUnmount",
|
|
150
171
|
value: function componentWillUnmount() {
|
|
151
|
-
var _this$
|
|
152
|
-
onDismiss = _this$
|
|
153
|
-
getValues = _this$
|
|
172
|
+
var _this$props4 = this.props,
|
|
173
|
+
onDismiss = _this$props4.onDismiss,
|
|
174
|
+
getValues = _this$props4.getValues;
|
|
154
175
|
|
|
155
176
|
if (onDismiss) {
|
|
156
177
|
onDismiss(getValues());
|
|
@@ -159,13 +180,12 @@ var InternalForm = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
159
180
|
}, {
|
|
160
181
|
key: "render",
|
|
161
182
|
value: function render() {
|
|
162
|
-
var _this$
|
|
163
|
-
|
|
164
|
-
_this$
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
handleCloseDialog = _this$props4.handleCloseDialog;
|
|
183
|
+
var _this$props5 = this.props,
|
|
184
|
+
_this$props5$integrat = _this$props5.integrationMode,
|
|
185
|
+
integrationMode = _this$props5$integrat === void 0 ? 'off' : _this$props5$integrat,
|
|
186
|
+
shareIntegrations = _this$props5.shareIntegrations,
|
|
187
|
+
onTabChange = _this$props5.onTabChange,
|
|
188
|
+
handleCloseDialog = _this$props5.handleCloseDialog;
|
|
169
189
|
|
|
170
190
|
if (integrationMode === 'off' || !shareIntegrations || !shareIntegrations.length) {
|
|
171
191
|
return this.renderShareForm();
|
|
@@ -181,7 +201,7 @@ var InternalForm = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
181
201
|
}
|
|
182
202
|
}, /*#__PURE__*/React.createElement(TabList, null, /*#__PURE__*/React.createElement(Tab, {
|
|
183
203
|
key: "share-tab-default"
|
|
184
|
-
},
|
|
204
|
+
}, this.renderMainTabTitle()), /*#__PURE__*/React.createElement(Tab, {
|
|
185
205
|
key: "share-tab-".concat(firstIntegration.type)
|
|
186
206
|
}, /*#__PURE__*/React.createElement(IntegrationWrapper, null, /*#__PURE__*/React.createElement(IntegrationIconWrapper, null, /*#__PURE__*/React.createElement(firstIntegration.Icon, null)), integrationTabText(firstIntegration.type)))), /*#__PURE__*/React.createElement(TabPanel, {
|
|
187
207
|
key: "share-tabPanel-default"
|
package/dist/esm/i18n.js
CHANGED
|
@@ -160,5 +160,15 @@ export var messages = defineMessages({
|
|
|
160
160
|
id: 'fabric.elements.share.in.integration.button',
|
|
161
161
|
defaultMessage: 'Share in {integrationName}',
|
|
162
162
|
description: 'Text for the button that allows the user to share the currently viewed item through a 3rd party app like Slack'
|
|
163
|
+
},
|
|
164
|
+
shareMainTabTextJira: {
|
|
165
|
+
id: 'fabric.elements.share.main.tab.text.jira',
|
|
166
|
+
defaultMessage: 'Share issue',
|
|
167
|
+
description: 'Text for the main share tab for jira'
|
|
168
|
+
},
|
|
169
|
+
shareMainTabTextConfluence: {
|
|
170
|
+
id: 'fabric.elements.share.main.tab.text.confluence',
|
|
171
|
+
defaultMessage: 'Share page',
|
|
172
|
+
description: 'Text for the main share tab for confluence'
|
|
163
173
|
}
|
|
164
174
|
});
|
package/dist/esm/version.json
CHANGED
package/dist/types/i18n.d.ts
CHANGED
|
@@ -159,4 +159,14 @@ export declare const messages: {
|
|
|
159
159
|
defaultMessage: string;
|
|
160
160
|
description: string;
|
|
161
161
|
};
|
|
162
|
+
shareMainTabTextJira: {
|
|
163
|
+
id: string;
|
|
164
|
+
defaultMessage: string;
|
|
165
|
+
description: string;
|
|
166
|
+
};
|
|
167
|
+
shareMainTabTextConfluence: {
|
|
168
|
+
id: string;
|
|
169
|
+
defaultMessage: string;
|
|
170
|
+
description: string;
|
|
171
|
+
};
|
|
162
172
|
};
|