@atlaskit/share 4.14.0 → 4.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +16 -0
- package/dist/cjs/components/CopyLinkButton.js +1 -1
- package/dist/cjs/components/IntegrationButton.js +1 -1
- package/dist/cjs/components/IntegrationForm.js +1 -1
- package/dist/cjs/components/ShareForm.js +2 -2
- package/dist/cjs/components/ShareHeader.js +1 -1
- package/dist/cjs/components/SplitButton.js +2 -3
- package/dist/cjs/components/UserPickerField.js +4 -2
- package/dist/cjs/components/analytics/analytics.js +1 -1
- package/dist/es2019/components/CopyLinkButton.js +1 -1
- package/dist/es2019/components/IntegrationButton.js +2 -1
- package/dist/es2019/components/IntegrationForm.js +1 -1
- package/dist/es2019/components/ShareForm.js +2 -2
- package/dist/es2019/components/ShareHeader.js +1 -1
- package/dist/es2019/components/SplitButton.js +9 -6
- package/dist/es2019/components/UserPickerField.js +4 -2
- package/dist/es2019/components/analytics/analytics.js +1 -1
- package/dist/esm/components/CopyLinkButton.js +1 -1
- package/dist/esm/components/IntegrationButton.js +1 -1
- package/dist/esm/components/IntegrationForm.js +1 -1
- package/dist/esm/components/ShareForm.js +2 -2
- package/dist/esm/components/ShareHeader.js +1 -1
- package/dist/esm/components/SplitButton.js +2 -3
- package/dist/esm/components/UserPickerField.js +4 -2
- package/dist/esm/components/analytics/analytics.js +1 -1
- package/dist/types/types/UserPickerOptions.d.ts +2 -2
- package/dist/types-ts4.5/types/UserPickerOptions.d.ts +2 -2
- package/docs/0-intro.tsx +12 -11
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @atlaskit/share
|
|
2
2
|
|
|
3
|
+
## 4.15.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#74889](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/74889) [`517e7e939fd6`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/517e7e939fd6) - [ux] Added `onFocus` UserPicker Option
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- Updated dependencies
|
|
12
|
+
|
|
13
|
+
## 4.14.1
|
|
14
|
+
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- [#74147](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/74147) [`a9a862061df0`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/a9a862061df0) - Enforce usage of spacing design tokens instead of hard-coded values
|
|
18
|
+
|
|
3
19
|
## 4.14.0
|
|
4
20
|
|
|
5
21
|
### Minor Changes
|
|
@@ -31,7 +31,7 @@ var Z_INDEX = _constants.layers.modal();
|
|
|
31
31
|
var AUTO_DISMISS_SECONDS = 8;
|
|
32
32
|
var AUTO_DISMISS_MS = exports.AUTO_DISMISS_MS = AUTO_DISMISS_SECONDS * 1000;
|
|
33
33
|
var messageContainerStyle = exports.messageContainerStyle = (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n align-items: center;\n margin: ", "\n ", ";\n"])), "var(--ds-space-negative-100, -8px)", "var(--ds-space-negative-200, -16px)");
|
|
34
|
-
var messageTextStyle = (0, _react2.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n text-indent:
|
|
34
|
+
var messageTextStyle = (0, _react2.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n text-indent: ", ";\n"])), "var(--ds-space-075, 6px)");
|
|
35
35
|
var isSafari = navigator.userAgent.indexOf('Safari');
|
|
36
36
|
var HiddenInput = exports.HiddenInput = /*#__PURE__*/_react.default.forwardRef(
|
|
37
37
|
// we need a hidden input to reliably copy to clipboard across all browsers.
|
|
@@ -15,7 +15,7 @@ var _excluded = ["text", "textColor", "IntegrationIcon"];
|
|
|
15
15
|
var _templateObject, _templateObject2;
|
|
16
16
|
/** @jsx jsx */
|
|
17
17
|
var integrationButtonCopyWrapperStyle = (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n justify-content: left;\n"])));
|
|
18
|
-
var integrationIconWrapperStyle = (0, _react2.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n margin:
|
|
18
|
+
var integrationIconWrapperStyle = (0, _react2.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n margin: ", " ", "\n ", " ", ";\n"])), "var(--ds-space-025, 2px)", "var(--ds-space-100, 8px)", "var(--ds-space-0, 0px)", "var(--ds-space-0, 0px)");
|
|
19
19
|
var IntegrationButton = function IntegrationButton(props) {
|
|
20
20
|
var text = props.text,
|
|
21
21
|
textColor = props.textColor,
|
|
@@ -11,7 +11,7 @@ var _react2 = require("@emotion/react");
|
|
|
11
11
|
var _typography = require("@atlaskit/theme/typography");
|
|
12
12
|
var _templateObject;
|
|
13
13
|
/** @jsx jsx */
|
|
14
|
-
var formWrapperStyle = exports.formWrapperStyle = (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n [class^='FormHeader__FormHeaderWrapper'] {\n h1:first-child {\n ", "\n\n > span {\n /* jira has a class override font settings on h1 > span in gh-custom-field-pickers.css */\n font-size: inherit !important;\n line-height: inherit !important;\n letter-spacing: inherit !important;\n }\n }\n }\n\n [class^='FormSection__FormSectionWrapper'] {\n margin-top:
|
|
14
|
+
var formWrapperStyle = exports.formWrapperStyle = (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n [class^='FormHeader__FormHeaderWrapper'] {\n h1:first-child {\n ", "\n\n > span {\n /* jira has a class override font settings on h1 > span in gh-custom-field-pickers.css */\n font-size: inherit !important;\n line-height: inherit !important;\n letter-spacing: inherit !important;\n }\n }\n }\n\n [class^='FormSection__FormSectionWrapper'] {\n margin-top: ", ";\n }\n\n [class^='FormFooter__FormFooterWrapper'] {\n justify-content: space-between;\n margin-top: ", ";\n margin-bottom: ", ";\n }\n\n [class^='Field__FieldWrapper']:not(:first-child) {\n margin-top: ", ";\n }\n"])), (0, _typography.h500)(), "var(--ds-space-0, 0px)", "var(--ds-space-150, 12px)", "var(--ds-space-300, 24px)", "var(--ds-space-150, 12px)");
|
|
15
15
|
var IntegrationForm = exports.IntegrationForm = function IntegrationForm(_ref) {
|
|
16
16
|
var Content = _ref.Content,
|
|
17
17
|
_ref$onIntegrationClo = _ref.onIntegrationClose,
|
|
@@ -43,12 +43,12 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
43
43
|
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); }; }
|
|
44
44
|
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; } }
|
|
45
45
|
var submitButtonWrapperStyles = (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n margin-left: auto;\n"])));
|
|
46
|
-
var centerAlignedIconWrapperStyles = (0, _react2.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n align-self: center;\n padding:
|
|
46
|
+
var centerAlignedIconWrapperStyles = (0, _react2.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n align-self: center;\n padding: ", " ", ";\n\n > div {\n line-height: 1;\n }\n"])), "var(--ds-space-0, 0px)", "var(--ds-space-150, 12px)");
|
|
47
47
|
var formWrapperStyles = exports.formWrapperStyles = (0, _react2.css)(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n margin-top: ", ";\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"])), "var(--ds-space-100, 8px)");
|
|
48
48
|
var formFooterStyles = exports.formFooterStyles = (0, _react2.css)(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n justify-content: flex-start;\n"])));
|
|
49
49
|
var formFieldStyles = (0, _react2.css)(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2.default)(["\n margin-bottom: ", ";\n"])), "var(--ds-space-150, 12px)");
|
|
50
50
|
var integrationWrapperStyles = (0, _react2.css)(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n align-items: center;\n"])));
|
|
51
|
-
var integrationIconWrapperStyles = (0, _react2.css)(_templateObject7 || (_templateObject7 = (0, _taggedTemplateLiteral2.default)(["\n margin-bottom: ", ";\n margin-right:
|
|
51
|
+
var integrationIconWrapperStyles = (0, _react2.css)(_templateObject7 || (_templateObject7 = (0, _taggedTemplateLiteral2.default)(["\n margin-bottom: ", ";\n margin-right: ", ";\n"])), "var(--ds-space-negative-075, -6px)", "var(--ds-space-050, 4px)");
|
|
52
52
|
var requiredFieldInfoStyles = (0, _react2.css)(_templateObject8 || (_templateObject8 = (0, _taggedTemplateLiteral2.default)(["\n margin-bottom: ", ";\n color: ", ";\n font-size: ", "px;\n"])), "var(--ds-space-200, 16px)", "var(--ds-text-subtle, ".concat(_colors.N300, ")"), (0, _constants.fontSizeSmall)());
|
|
53
53
|
var integrationTabText = function integrationTabText(integrationName) {
|
|
54
54
|
return (0, _react2.jsx)(_reactIntlNext.FormattedMessage, (0, _extends2.default)({}, _i18n.messages.shareInIntegrationButtonText, {
|
|
@@ -15,7 +15,7 @@ var _templateObject, _templateObject2;
|
|
|
15
15
|
/** @jsx jsx */
|
|
16
16
|
var headerWrapperStyles = (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n justify-content: space-between;\n"])));
|
|
17
17
|
var getFormHeaderTitleStyles = exports.getFormHeaderTitleStyles = function getFormHeaderTitleStyles(theme) {
|
|
18
|
-
return (0, _react2.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n ", "\n line-height:
|
|
18
|
+
return (0, _react2.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n ", "\n line-height: ", ";\n margin-right: ", ";\n margin-top: ", ";\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n\n > span {\n font-size: initial;\n }\n"])), (0, _typography.h500)(theme), "var(--ds-space-400, 32px)", "var(--ds-space-400, 32px)", "var(--ds-space-400, 32px)");
|
|
19
19
|
};
|
|
20
20
|
var ShareHeader = exports.ShareHeader = function ShareHeader(_ref) {
|
|
21
21
|
var title = _ref.title;
|
|
@@ -16,7 +16,6 @@ var _standardButton = _interopRequireDefault(require("@atlaskit/button/standard-
|
|
|
16
16
|
var _dropdownMenu = _interopRequireWildcard(require("@atlaskit/dropdown-menu"));
|
|
17
17
|
var _chevronDown = _interopRequireDefault(require("@atlaskit/icon/glyph/chevron-down"));
|
|
18
18
|
var _colors = require("@atlaskit/theme/colors");
|
|
19
|
-
var _constants = require("@atlaskit/theme/constants");
|
|
20
19
|
var _i18n = require("../i18n");
|
|
21
20
|
var _analytics = require("./analytics/analytics");
|
|
22
21
|
var _IntegrationButton = _interopRequireDefault(require("./IntegrationButton"));
|
|
@@ -25,8 +24,8 @@ var _templateObject, _templateObject2, _templateObject3;
|
|
|
25
24
|
/** @jsx jsx */
|
|
26
25
|
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); }
|
|
27
26
|
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; }
|
|
28
|
-
var splitButtonWrapperStyles = (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n button {\n border-radius: ", "
|
|
29
|
-
var dropdownMenuWrapperStyles = (0, _react2.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n margin-left:
|
|
27
|
+
var splitButtonWrapperStyles = (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n button {\n border-radius: ", " ", "\n ", " ", ";\n }\n button:hover {\n border-radius: ", " ", "\n ", " ", ";\n }\n"])), "var(--ds-border-radius, 3px)", "var(--ds-space-0, 0px)", "var(--ds-space-0, 0px)", "var(--ds-border-radius, 3px)", "var(--ds-border-radius, 3px)", "var(--ds-space-0, 0px)", "var(--ds-space-0, 0px)", "var(--ds-border-radius, 3px)");
|
|
28
|
+
var dropdownMenuWrapperStyles = (0, _react2.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n margin-left: ", ";\n button {\n border-radius: ", " ", "\n ", " ", ";\n }\n button:hover {\n border-radius: ", " ", "\n ", " ", ";\n }\n"])), "var(--ds-space-025, 2px)", "var(--ds-space-0, 0px)", "var(--ds-border-radius, 3px)", "var(--ds-border-radius, 3px)", "var(--ds-space-0, 0px)", "var(--ds-space-0, 0px)", "var(--ds-border-radius, 3px)", "var(--ds-border-radius, 3px)", "var(--ds-space-0, 0px)");
|
|
30
29
|
|
|
31
30
|
// span
|
|
32
31
|
var dropDownIntegrationButtonWrapperStyles = (0, _react2.css)(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n button:hover {\n background: transparent;\n }\n"])));
|
|
@@ -194,7 +194,8 @@ var UserPickerFieldComponent = exports.UserPickerFieldComponent = /*#__PURE__*/f
|
|
|
194
194
|
var requiredMessage = getRequiredMessage(product, allowEmail, isBrowseUsersDisabled);
|
|
195
195
|
var _ref2 = userPickerOptions !== null && userPickerOptions !== void 0 ? userPickerOptions : {},
|
|
196
196
|
header = _ref2.header,
|
|
197
|
-
noOptionsMessageHandler = _ref2.noOptionsMessageHandler
|
|
197
|
+
noOptionsMessageHandler = _ref2.noOptionsMessageHandler,
|
|
198
|
+
onFocus = _ref2.onFocus;
|
|
198
199
|
var commonPickerProps = {
|
|
199
200
|
fieldId: 'share',
|
|
200
201
|
loadOptions: this.loadOptions,
|
|
@@ -206,7 +207,8 @@ var UserPickerFieldComponent = exports.UserPickerFieldComponent = /*#__PURE__*/f
|
|
|
206
207
|
onInputChange: onInputChange,
|
|
207
208
|
maxPickerHeight: _styles.MAX_PICKER_HEIGHT,
|
|
208
209
|
textFieldBackgroundColor: true,
|
|
209
|
-
header: header
|
|
210
|
+
header: header,
|
|
211
|
+
onFocus: onFocus
|
|
210
212
|
};
|
|
211
213
|
var UserPickerComponent = enableSmartUserPicker && !isBrowseUsersDisabled ? _smartUserPicker.default : _userPicker.default;
|
|
212
214
|
var menuPortalTarget = (0, _utils.getMenuPortalTargetCurrentHTML)(selectPortalRef);
|
|
@@ -13,7 +13,7 @@ var buildAttributes = function buildAttributes() {
|
|
|
13
13
|
var attributes = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
14
14
|
return _objectSpread({
|
|
15
15
|
packageName: "@atlaskit/share",
|
|
16
|
-
packageVersion: "4.
|
|
16
|
+
packageVersion: "4.15.0"
|
|
17
17
|
}, attributes);
|
|
18
18
|
};
|
|
19
19
|
var createEvent = function createEvent(eventType, source, action, actionSubject, actionSubjectId) {
|
|
@@ -20,7 +20,7 @@ export const messageContainerStyle = css`
|
|
|
20
20
|
${"var(--ds-space-negative-200, -16px)"};
|
|
21
21
|
`;
|
|
22
22
|
const messageTextStyle = css`
|
|
23
|
-
text-indent: 6px;
|
|
23
|
+
text-indent: ${"var(--ds-space-075, 6px)"};
|
|
24
24
|
`;
|
|
25
25
|
const isSafari = navigator.userAgent.indexOf('Safari');
|
|
26
26
|
export const HiddenInput = /*#__PURE__*/React.forwardRef(
|
|
@@ -8,7 +8,8 @@ const integrationButtonCopyWrapperStyle = css`
|
|
|
8
8
|
justify-content: left;
|
|
9
9
|
`;
|
|
10
10
|
const integrationIconWrapperStyle = css`
|
|
11
|
-
margin:
|
|
11
|
+
margin: ${"var(--ds-space-025, 2px)"} ${"var(--ds-space-100, 8px)"}
|
|
12
|
+
${"var(--ds-space-0, 0px)"} ${"var(--ds-space-0, 0px)"};
|
|
12
13
|
`;
|
|
13
14
|
const IntegrationButton = props => {
|
|
14
15
|
const {
|
|
@@ -27,7 +27,7 @@ const submitButtonWrapperStyles = css`
|
|
|
27
27
|
const centerAlignedIconWrapperStyles = css`
|
|
28
28
|
display: flex;
|
|
29
29
|
align-self: center;
|
|
30
|
-
padding: 0
|
|
30
|
+
padding: ${"var(--ds-space-0, 0px)"} ${"var(--ds-space-150, 12px)"};
|
|
31
31
|
|
|
32
32
|
> div {
|
|
33
33
|
line-height: 1;
|
|
@@ -55,7 +55,7 @@ const integrationWrapperStyles = css`
|
|
|
55
55
|
`;
|
|
56
56
|
const integrationIconWrapperStyles = css`
|
|
57
57
|
margin-bottom: ${"var(--ds-space-negative-075, -6px)"};
|
|
58
|
-
margin-right:
|
|
58
|
+
margin-right: ${"var(--ds-space-050, 4px)"};
|
|
59
59
|
`;
|
|
60
60
|
const requiredFieldInfoStyles = css`
|
|
61
61
|
margin-bottom: ${"var(--ds-space-200, 16px)"};
|
|
@@ -10,7 +10,7 @@ const headerWrapperStyles = css`
|
|
|
10
10
|
`;
|
|
11
11
|
export const getFormHeaderTitleStyles = theme => css`
|
|
12
12
|
${h500(theme)}
|
|
13
|
-
line-height: 32px;
|
|
13
|
+
line-height: ${"var(--ds-space-400, 32px)"};
|
|
14
14
|
margin-right: ${"var(--ds-space-400, 32px)"};
|
|
15
15
|
margin-top: ${"var(--ds-space-400, 32px)"};
|
|
16
16
|
overflow: hidden;
|
|
@@ -7,26 +7,29 @@ import Button from '@atlaskit/button/standard-button';
|
|
|
7
7
|
import DropdownMenu, { DropdownItem, DropdownItemGroup } from '@atlaskit/dropdown-menu';
|
|
8
8
|
import ChevronDownIcon from '@atlaskit/icon/glyph/chevron-down';
|
|
9
9
|
import { N800 } from '@atlaskit/theme/colors';
|
|
10
|
-
import { borderRadius } from '@atlaskit/theme/constants';
|
|
11
10
|
import { messages } from '../i18n';
|
|
12
11
|
import { shareIntegrationButtonEvent } from './analytics/analytics';
|
|
13
12
|
import IntegrationButton from './IntegrationButton';
|
|
14
13
|
const splitButtonWrapperStyles = css`
|
|
15
14
|
display: flex;
|
|
16
15
|
button {
|
|
17
|
-
border-radius: ${
|
|
16
|
+
border-radius: ${"var(--ds-border-radius, 3px)"} ${"var(--ds-space-0, 0px)"}
|
|
17
|
+
${"var(--ds-space-0, 0px)"} ${"var(--ds-border-radius, 3px)"};
|
|
18
18
|
}
|
|
19
19
|
button:hover {
|
|
20
|
-
border-radius: ${
|
|
20
|
+
border-radius: ${"var(--ds-border-radius, 3px)"} ${"var(--ds-space-0, 0px)"}
|
|
21
|
+
${"var(--ds-space-0, 0px)"} ${"var(--ds-border-radius, 3px)"};
|
|
21
22
|
}
|
|
22
23
|
`;
|
|
23
24
|
const dropdownMenuWrapperStyles = css`
|
|
24
|
-
margin-left:
|
|
25
|
+
margin-left: ${"var(--ds-space-025, 2px)"};
|
|
25
26
|
button {
|
|
26
|
-
border-radius:
|
|
27
|
+
border-radius: ${"var(--ds-space-0, 0px)"} ${"var(--ds-border-radius, 3px)"}
|
|
28
|
+
${"var(--ds-border-radius, 3px)"} ${"var(--ds-space-0, 0px)"};
|
|
27
29
|
}
|
|
28
30
|
button:hover {
|
|
29
|
-
border-radius:
|
|
31
|
+
border-radius: ${"var(--ds-space-0, 0px)"} ${"var(--ds-border-radius, 3px)"}
|
|
32
|
+
${"var(--ds-border-radius, 3px)"} ${"var(--ds-space-0, 0px)"};
|
|
30
33
|
}
|
|
31
34
|
`;
|
|
32
35
|
|
|
@@ -161,7 +161,8 @@ export class UserPickerFieldComponent extends React.Component {
|
|
|
161
161
|
const requiredMessage = getRequiredMessage(product, allowEmail, isBrowseUsersDisabled);
|
|
162
162
|
const {
|
|
163
163
|
header,
|
|
164
|
-
noOptionsMessageHandler
|
|
164
|
+
noOptionsMessageHandler,
|
|
165
|
+
onFocus
|
|
165
166
|
} = userPickerOptions !== null && userPickerOptions !== void 0 ? userPickerOptions : {};
|
|
166
167
|
const commonPickerProps = {
|
|
167
168
|
fieldId: 'share',
|
|
@@ -174,7 +175,8 @@ export class UserPickerFieldComponent extends React.Component {
|
|
|
174
175
|
onInputChange: onInputChange,
|
|
175
176
|
maxPickerHeight: MAX_PICKER_HEIGHT,
|
|
176
177
|
textFieldBackgroundColor: true,
|
|
177
|
-
header
|
|
178
|
+
header,
|
|
179
|
+
onFocus
|
|
178
180
|
};
|
|
179
181
|
const UserPickerComponent = enableSmartUserPicker && !isBrowseUsersDisabled ? SmartUserPicker : UserPicker;
|
|
180
182
|
const menuPortalTarget = getMenuPortalTargetCurrentHTML(selectPortalRef);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { isEmail, isTeam, isUser } from '@atlaskit/smart-user-picker';
|
|
2
2
|
const buildAttributes = (attributes = {}) => ({
|
|
3
3
|
packageName: "@atlaskit/share",
|
|
4
|
-
packageVersion: "4.
|
|
4
|
+
packageVersion: "4.15.0",
|
|
5
5
|
...attributes
|
|
6
6
|
});
|
|
7
7
|
const createEvent = (eventType, source, action, actionSubject, actionSubjectId, attributes = {}) => ({
|
|
@@ -24,7 +24,7 @@ var Z_INDEX = layers.modal();
|
|
|
24
24
|
var AUTO_DISMISS_SECONDS = 8;
|
|
25
25
|
export var AUTO_DISMISS_MS = AUTO_DISMISS_SECONDS * 1000;
|
|
26
26
|
export var messageContainerStyle = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n align-items: center;\n margin: ", "\n ", ";\n"])), "var(--ds-space-negative-100, -8px)", "var(--ds-space-negative-200, -16px)");
|
|
27
|
-
var messageTextStyle = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n text-indent:
|
|
27
|
+
var messageTextStyle = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n text-indent: ", ";\n"])), "var(--ds-space-075, 6px)");
|
|
28
28
|
var isSafari = navigator.userAgent.indexOf('Safari');
|
|
29
29
|
export var HiddenInput = /*#__PURE__*/React.forwardRef(
|
|
30
30
|
// we need a hidden input to reliably copy to clipboard across all browsers.
|
|
@@ -8,7 +8,7 @@ import { css, jsx } from '@emotion/react';
|
|
|
8
8
|
import Button from '@atlaskit/button/custom-theme-button';
|
|
9
9
|
import { N500 } from '@atlaskit/theme/colors';
|
|
10
10
|
var integrationButtonCopyWrapperStyle = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n justify-content: left;\n"])));
|
|
11
|
-
var integrationIconWrapperStyle = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n margin:
|
|
11
|
+
var integrationIconWrapperStyle = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n margin: ", " ", "\n ", " ", ";\n"])), "var(--ds-space-025, 2px)", "var(--ds-space-100, 8px)", "var(--ds-space-0, 0px)", "var(--ds-space-0, 0px)");
|
|
12
12
|
var IntegrationButton = function IntegrationButton(props) {
|
|
13
13
|
var text = props.text,
|
|
14
14
|
textColor = props.textColor,
|
|
@@ -4,7 +4,7 @@ var _templateObject;
|
|
|
4
4
|
import React from 'react';
|
|
5
5
|
import { css, jsx } from '@emotion/react';
|
|
6
6
|
import { h500 } from '@atlaskit/theme/typography';
|
|
7
|
-
export var formWrapperStyle = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n [class^='FormHeader__FormHeaderWrapper'] {\n h1:first-child {\n ", "\n\n > span {\n /* jira has a class override font settings on h1 > span in gh-custom-field-pickers.css */\n font-size: inherit !important;\n line-height: inherit !important;\n letter-spacing: inherit !important;\n }\n }\n }\n\n [class^='FormSection__FormSectionWrapper'] {\n margin-top:
|
|
7
|
+
export var formWrapperStyle = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n [class^='FormHeader__FormHeaderWrapper'] {\n h1:first-child {\n ", "\n\n > span {\n /* jira has a class override font settings on h1 > span in gh-custom-field-pickers.css */\n font-size: inherit !important;\n line-height: inherit !important;\n letter-spacing: inherit !important;\n }\n }\n }\n\n [class^='FormSection__FormSectionWrapper'] {\n margin-top: ", ";\n }\n\n [class^='FormFooter__FormFooterWrapper'] {\n justify-content: space-between;\n margin-top: ", ";\n margin-bottom: ", ";\n }\n\n [class^='Field__FieldWrapper']:not(:first-child) {\n margin-top: ", ";\n }\n"])), h500(), "var(--ds-space-0, 0px)", "var(--ds-space-150, 12px)", "var(--ds-space-300, 24px)", "var(--ds-space-150, 12px)");
|
|
8
8
|
export var IntegrationForm = function IntegrationForm(_ref) {
|
|
9
9
|
var Content = _ref.Content,
|
|
10
10
|
_ref$onIntegrationClo = _ref.onIntegrationClose,
|
|
@@ -33,12 +33,12 @@ import { IntegrationForm } from './IntegrationForm';
|
|
|
33
33
|
import { ShareHeader } from './ShareHeader';
|
|
34
34
|
import { UserPickerField } from './UserPickerField';
|
|
35
35
|
var submitButtonWrapperStyles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n margin-left: auto;\n"])));
|
|
36
|
-
var centerAlignedIconWrapperStyles = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n display: flex;\n align-self: center;\n padding:
|
|
36
|
+
var centerAlignedIconWrapperStyles = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n display: flex;\n align-self: center;\n padding: ", " ", ";\n\n > div {\n line-height: 1;\n }\n"])), "var(--ds-space-0, 0px)", "var(--ds-space-150, 12px)");
|
|
37
37
|
export var formWrapperStyles = css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n margin-top: ", ";\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"])), "var(--ds-space-100, 8px)");
|
|
38
38
|
export var formFooterStyles = css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n display: flex;\n justify-content: flex-start;\n"])));
|
|
39
39
|
var formFieldStyles = css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n margin-bottom: ", ";\n"])), "var(--ds-space-150, 12px)");
|
|
40
40
|
var integrationWrapperStyles = css(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n display: flex;\n align-items: center;\n"])));
|
|
41
|
-
var integrationIconWrapperStyles = css(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n margin-bottom: ", ";\n margin-right:
|
|
41
|
+
var integrationIconWrapperStyles = css(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n margin-bottom: ", ";\n margin-right: ", ";\n"])), "var(--ds-space-negative-075, -6px)", "var(--ds-space-050, 4px)");
|
|
42
42
|
var requiredFieldInfoStyles = css(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["\n margin-bottom: ", ";\n color: ", ";\n font-size: ", "px;\n"])), "var(--ds-space-200, 16px)", "var(--ds-text-subtle, ".concat(N300, ")"), fontSizeSmall());
|
|
43
43
|
var integrationTabText = function integrationTabText(integrationName) {
|
|
44
44
|
return jsx(FormattedMessage, _extends({}, messages.shareInIntegrationButtonText, {
|
|
@@ -8,7 +8,7 @@ import { h500 } from '@atlaskit/theme/typography';
|
|
|
8
8
|
import { messages } from '../i18n';
|
|
9
9
|
var headerWrapperStyles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n justify-content: space-between;\n"])));
|
|
10
10
|
export var getFormHeaderTitleStyles = function getFormHeaderTitleStyles(theme) {
|
|
11
|
-
return css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n ", "\n line-height:
|
|
11
|
+
return css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n ", "\n line-height: ", ";\n margin-right: ", ";\n margin-top: ", ";\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n\n > span {\n font-size: initial;\n }\n"])), h500(theme), "var(--ds-space-400, 32px)", "var(--ds-space-400, 32px)", "var(--ds-space-400, 32px)");
|
|
12
12
|
};
|
|
13
13
|
export var ShareHeader = function ShareHeader(_ref) {
|
|
14
14
|
var title = _ref.title;
|
|
@@ -11,12 +11,11 @@ import Button from '@atlaskit/button/standard-button';
|
|
|
11
11
|
import DropdownMenu, { DropdownItem, DropdownItemGroup } from '@atlaskit/dropdown-menu';
|
|
12
12
|
import ChevronDownIcon from '@atlaskit/icon/glyph/chevron-down';
|
|
13
13
|
import { N800 } from '@atlaskit/theme/colors';
|
|
14
|
-
import { borderRadius } from '@atlaskit/theme/constants';
|
|
15
14
|
import { messages } from '../i18n';
|
|
16
15
|
import { shareIntegrationButtonEvent } from './analytics/analytics';
|
|
17
16
|
import IntegrationButton from './IntegrationButton';
|
|
18
|
-
var splitButtonWrapperStyles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n button {\n border-radius: ", "
|
|
19
|
-
var dropdownMenuWrapperStyles = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n margin-left:
|
|
17
|
+
var splitButtonWrapperStyles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n button {\n border-radius: ", " ", "\n ", " ", ";\n }\n button:hover {\n border-radius: ", " ", "\n ", " ", ";\n }\n"])), "var(--ds-border-radius, 3px)", "var(--ds-space-0, 0px)", "var(--ds-space-0, 0px)", "var(--ds-border-radius, 3px)", "var(--ds-border-radius, 3px)", "var(--ds-space-0, 0px)", "var(--ds-space-0, 0px)", "var(--ds-border-radius, 3px)");
|
|
18
|
+
var dropdownMenuWrapperStyles = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n margin-left: ", ";\n button {\n border-radius: ", " ", "\n ", " ", ";\n }\n button:hover {\n border-radius: ", " ", "\n ", " ", ";\n }\n"])), "var(--ds-space-025, 2px)", "var(--ds-space-0, 0px)", "var(--ds-border-radius, 3px)", "var(--ds-border-radius, 3px)", "var(--ds-space-0, 0px)", "var(--ds-space-0, 0px)", "var(--ds-border-radius, 3px)", "var(--ds-border-radius, 3px)", "var(--ds-space-0, 0px)");
|
|
20
19
|
|
|
21
20
|
// span
|
|
22
21
|
var dropDownIntegrationButtonWrapperStyles = css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n button:hover {\n background: transparent;\n }\n"])));
|
|
@@ -184,7 +184,8 @@ export var UserPickerFieldComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
184
184
|
var requiredMessage = getRequiredMessage(product, allowEmail, isBrowseUsersDisabled);
|
|
185
185
|
var _ref2 = userPickerOptions !== null && userPickerOptions !== void 0 ? userPickerOptions : {},
|
|
186
186
|
header = _ref2.header,
|
|
187
|
-
noOptionsMessageHandler = _ref2.noOptionsMessageHandler
|
|
187
|
+
noOptionsMessageHandler = _ref2.noOptionsMessageHandler,
|
|
188
|
+
onFocus = _ref2.onFocus;
|
|
188
189
|
var commonPickerProps = {
|
|
189
190
|
fieldId: 'share',
|
|
190
191
|
loadOptions: this.loadOptions,
|
|
@@ -196,7 +197,8 @@ export var UserPickerFieldComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
196
197
|
onInputChange: onInputChange,
|
|
197
198
|
maxPickerHeight: MAX_PICKER_HEIGHT,
|
|
198
199
|
textFieldBackgroundColor: true,
|
|
199
|
-
header: header
|
|
200
|
+
header: header,
|
|
201
|
+
onFocus: onFocus
|
|
200
202
|
};
|
|
201
203
|
var UserPickerComponent = enableSmartUserPicker && !isBrowseUsersDisabled ? SmartUserPicker : UserPicker;
|
|
202
204
|
var menuPortalTarget = getMenuPortalTargetCurrentHTML(selectPortalRef);
|
|
@@ -6,7 +6,7 @@ var buildAttributes = function buildAttributes() {
|
|
|
6
6
|
var attributes = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
7
7
|
return _objectSpread({
|
|
8
8
|
packageName: "@atlaskit/share",
|
|
9
|
-
packageVersion: "4.
|
|
9
|
+
packageVersion: "4.15.0"
|
|
10
10
|
}, attributes);
|
|
11
11
|
};
|
|
12
12
|
var createEvent = function createEvent(eventType, source, action, actionSubject, actionSubjectId) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
import type { UserPickerProps } from '@atlaskit/user-picker';
|
|
3
|
+
export type UserPickerOptions = Pick<UserPickerProps, 'onFocus' | 'header'> & {
|
|
4
4
|
/** Message to be shown when the menu is open but no options are provided.
|
|
5
5
|
* If message is null, no message will be displayed.
|
|
6
6
|
* If message is undefined, default message will be displayed.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
import type { UserPickerProps } from '@atlaskit/user-picker';
|
|
3
|
+
export type UserPickerOptions = Pick<UserPickerProps, 'onFocus' | 'header'> & {
|
|
4
4
|
/** Message to be shown when the menu is open but no options are provided.
|
|
5
5
|
* If message is null, no message will be displayed.
|
|
6
6
|
* If message is undefined, default message will be displayed.
|
package/docs/0-intro.tsx
CHANGED
|
@@ -8,14 +8,15 @@ import {
|
|
|
8
8
|
md,
|
|
9
9
|
Props,
|
|
10
10
|
} from '@atlaskit/docs';
|
|
11
|
+
import { token } from '@atlaskit/tokens';
|
|
11
12
|
|
|
12
13
|
export default md`
|
|
13
14
|
${(
|
|
14
15
|
<>
|
|
15
|
-
<div style={{ marginBottom: '
|
|
16
|
+
<div style={{ marginBottom: `${token('space.100', '8px')}` }}>
|
|
16
17
|
<AtlassianInternalWarning />
|
|
17
18
|
</div>
|
|
18
|
-
<div style={{ marginTop: '
|
|
19
|
+
<div style={{ marginTop: `${token('space.100', '8px')}` }}>
|
|
19
20
|
<DevPreviewWarning />
|
|
20
21
|
</div>
|
|
21
22
|
</>
|
|
@@ -23,15 +24,15 @@ export default md`
|
|
|
23
24
|
|
|
24
25
|
This package provides the view components allowing users to share a resource by
|
|
25
26
|
sharing with User Picker, or by copying the share link.
|
|
26
|
-
|
|
27
|
+
|
|
27
28
|
The goal is to provide a consistent share experience across products.
|
|
28
|
-
|
|
29
|
-
## Usage
|
|
30
|
-
|
|
29
|
+
|
|
30
|
+
## Usage
|
|
31
|
+
|
|
31
32
|
Import the component in your React app as follows:
|
|
32
|
-
|
|
33
|
+
|
|
33
34
|
${code`import ShareDialogContainer from '@atlaskit/share;`}
|
|
34
|
-
|
|
35
|
+
|
|
35
36
|
${(
|
|
36
37
|
<Example
|
|
37
38
|
packageName="@atlaskit/share"
|
|
@@ -40,16 +41,16 @@ export default md`
|
|
|
40
41
|
source={require('!!raw-loader!../examples/00-integration-with-configs')}
|
|
41
42
|
/>
|
|
42
43
|
)}
|
|
43
|
-
|
|
44
|
+
|
|
44
45
|
${(
|
|
45
46
|
<Props
|
|
46
47
|
heading="Share Props"
|
|
47
48
|
props={require('!!extract-react-types-loader!../src/components/ShareDialogContainer')}
|
|
48
49
|
/>
|
|
49
50
|
)}
|
|
50
|
-
|
|
51
|
+
|
|
51
52
|
## Notes
|
|
52
|
-
|
|
53
|
+
|
|
53
54
|
The share modal will be instantiated immediately but starts hidden.
|
|
54
55
|
It will **retain the form state** until the user either:
|
|
55
56
|
- triggers a share = share completed
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/share",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.15.0",
|
|
4
4
|
"description": "Fabric Share Element",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -49,15 +49,15 @@
|
|
|
49
49
|
"@atlaskit/popper": "^5.5.4",
|
|
50
50
|
"@atlaskit/popup": "^1.12.0",
|
|
51
51
|
"@atlaskit/portal": "^4.4.0",
|
|
52
|
-
"@atlaskit/smart-user-picker": "^6.
|
|
52
|
+
"@atlaskit/smart-user-picker": "^6.8.0",
|
|
53
53
|
"@atlaskit/spinner": "^16.0.0",
|
|
54
54
|
"@atlaskit/tabs": "^14.0.0",
|
|
55
55
|
"@atlaskit/textarea": "^5.0.0",
|
|
56
56
|
"@atlaskit/theme": "^12.6.0",
|
|
57
|
-
"@atlaskit/tokens": "^1.
|
|
57
|
+
"@atlaskit/tokens": "^1.38.0",
|
|
58
58
|
"@atlaskit/tooltip": "^18.1.0",
|
|
59
59
|
"@atlaskit/ufo": "^0.2.0",
|
|
60
|
-
"@atlaskit/user-picker": "^10.
|
|
60
|
+
"@atlaskit/user-picker": "^10.19.0",
|
|
61
61
|
"@atlaskit/util-service-support": "^6.2.0",
|
|
62
62
|
"@babel/runtime": "^7.0.0",
|
|
63
63
|
"@emotion/react": "^11.7.1",
|