@atlaskit/share 4.1.0 → 4.2.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.
Files changed (30) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/dist/cjs/clients/AtlassianUrlShortenerClient.js +40 -42
  3. package/dist/cjs/components/CopyLinkButton.js +1 -0
  4. package/dist/cjs/components/IntegrationButton.js +1 -0
  5. package/dist/cjs/components/IntegrationForm.js +1 -0
  6. package/dist/cjs/components/LazyShareForm/lazy.js +3 -2
  7. package/dist/cjs/components/ShareDialogContainer.js +55 -55
  8. package/dist/cjs/components/ShareDialogWithTrigger.js +7 -0
  9. package/dist/cjs/components/ShareForm.js +1 -0
  10. package/dist/cjs/components/ShareHeader.js +1 -0
  11. package/dist/cjs/components/SplitButton.js +1 -0
  12. package/dist/cjs/components/analytics/analytics.js +1 -1
  13. package/dist/cjs/components/utils.js +3 -0
  14. package/dist/cjs/types/ShareEntities.js +4 -4
  15. package/dist/cjs/version.json +1 -1
  16. package/dist/es2019/components/ShareDialogContainer.js +3 -0
  17. package/dist/es2019/components/ShareDialogWithTrigger.js +5 -0
  18. package/dist/es2019/components/analytics/analytics.js +1 -1
  19. package/dist/es2019/components/utils.js +0 -1
  20. package/dist/es2019/types/ShareEntities.js +3 -3
  21. package/dist/es2019/version.json +1 -1
  22. package/dist/esm/clients/AtlassianUrlShortenerClient.js +40 -42
  23. package/dist/esm/components/ShareDialogContainer.js +55 -55
  24. package/dist/esm/components/ShareDialogWithTrigger.js +5 -0
  25. package/dist/esm/components/analytics/analytics.js +1 -1
  26. package/dist/esm/components/utils.js +0 -1
  27. package/dist/esm/types/ShareEntities.js +3 -3
  28. package/dist/esm/version.json +1 -1
  29. package/package.json +25 -25
  30. package/tmp/api-report-tmp.d.ts +0 -319
package/CHANGELOG.md CHANGED
@@ -1,5 +1,22 @@
1
1
  # @atlaskit/share
2
2
 
3
+ ## 4.2.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`56507598609`](https://bitbucket.org/atlassian/atlassian-frontend/commits/56507598609) - Skip minor dependency bump
8
+
9
+ ### Patch Changes
10
+
11
+ - Updated dependencies
12
+
13
+ ## 4.1.1
14
+
15
+ ### Patch Changes
16
+
17
+ - [`2e01c9c74b5`](https://bitbucket.org/atlassian/atlassian-frontend/commits/2e01c9c74b5) - DUMMY remove before merging to master; dupe adf-schema via adf-utils
18
+ - Updated dependencies
19
+
3
20
  ## 4.1.0
4
21
 
5
22
  ### Minor Changes
@@ -19,48 +19,46 @@ var AtlassianUrlShortenerClient = /*#__PURE__*/function () {
19
19
  var _shorten = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(data) {
20
20
  var response, result;
21
21
  return _regenerator.default.wrap(function _callee$(_context) {
22
- while (1) {
23
- switch (_context.prev = _context.next) {
24
- case 0:
25
- _context.prev = 0;
26
- _context.next = 3;
27
- return fetch('/gateway/api/atl-link/create', {
28
- method: 'POST',
29
- headers: {
30
- 'Content-Type': 'application/json'
31
- },
32
- body: JSON.stringify(data)
33
- });
34
- case 3:
35
- response = _context.sent;
36
- if (response.ok) {
37
- _context.next = 6;
38
- break;
39
- }
40
- throw new Error("status=\"".concat(response.status, "\""));
41
- case 6:
42
- _context.next = 8;
43
- return response.json();
44
- case 8:
45
- result = _context.sent;
46
- if (result.shortUrl) {
47
- _context.next = 11;
48
- break;
49
- }
50
- throw new Error('Breach of contract!');
51
- case 11:
52
- return _context.abrupt("return", result);
53
- case 14:
54
- _context.prev = 14;
55
- _context.t0 = _context["catch"](0);
56
- if (_context.t0 instanceof Error) {
57
- _context.t0.message = "While shortening URL: ".concat(_context.t0.message, "!");
58
- }
59
- throw _context.t0;
60
- case 18:
61
- case "end":
62
- return _context.stop();
63
- }
22
+ while (1) switch (_context.prev = _context.next) {
23
+ case 0:
24
+ _context.prev = 0;
25
+ _context.next = 3;
26
+ return fetch('/gateway/api/atl-link/create', {
27
+ method: 'POST',
28
+ headers: {
29
+ 'Content-Type': 'application/json'
30
+ },
31
+ body: JSON.stringify(data)
32
+ });
33
+ case 3:
34
+ response = _context.sent;
35
+ if (response.ok) {
36
+ _context.next = 6;
37
+ break;
38
+ }
39
+ throw new Error("status=\"".concat(response.status, "\""));
40
+ case 6:
41
+ _context.next = 8;
42
+ return response.json();
43
+ case 8:
44
+ result = _context.sent;
45
+ if (result.shortUrl) {
46
+ _context.next = 11;
47
+ break;
48
+ }
49
+ throw new Error('Breach of contract!');
50
+ case 11:
51
+ return _context.abrupt("return", result);
52
+ case 14:
53
+ _context.prev = 14;
54
+ _context.t0 = _context["catch"](0);
55
+ if (_context.t0 instanceof Error) {
56
+ _context.t0.message = "While shortening URL: ".concat(_context.t0.message, "!");
57
+ }
58
+ throw _context.t0;
59
+ case 18:
60
+ case "end":
61
+ return _context.stop();
64
62
  }
65
63
  }, _callee, null, [[0, 14]]);
66
64
  }));
@@ -25,6 +25,7 @@ var _tooltip = _interopRequireDefault(require("@atlaskit/tooltip"));
25
25
  var _styled = require("./ShareFormWrapper/styled");
26
26
  var _styles = _interopRequireDefault(require("./styles"));
27
27
  var _templateObject, _templateObject2;
28
+ /** @jsx jsx */
28
29
  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); }; }
29
30
  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; } }
30
31
  var Z_INDEX = _constants.layers.modal();
@@ -13,6 +13,7 @@ var _customThemeButton = _interopRequireDefault(require("@atlaskit/button/custom
13
13
  var _colors = require("@atlaskit/theme/colors");
14
14
  var _excluded = ["text", "textColor", "IntegrationIcon"];
15
15
  var _templateObject, _templateObject2;
16
+ /** @jsx jsx */
16
17
  var integrationButtonCopyWrapperStyle = (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n justify-content: left;\n"])));
17
18
  var integrationIconWrapperStyle = (0, _react2.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n margin: 1px 8px 0 0;\n"])));
18
19
  var IntegrationButton = function IntegrationButton(props) {
@@ -10,6 +10,7 @@ var _react = _interopRequireDefault(require("react"));
10
10
  var _react2 = require("@emotion/react");
11
11
  var _typography = require("@atlaskit/theme/typography");
12
12
  var _templateObject;
13
+ /** @jsx jsx */
13
14
  var 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: 0px;\n }\n\n [class^='FormFooter__FormFooterWrapper'] {\n justify-content: space-between;\n margin-top: 12px;\n margin-bottom: 24px;\n }\n\n [class^='Field__FieldWrapper']:not(:first-child) {\n margin-top: 12px;\n }\n"])), (0, _typography.h500)());
14
15
  exports.formWrapperStyle = formWrapperStyle;
15
16
  var IntegrationForm = function IntegrationForm(_ref) {
@@ -12,10 +12,11 @@ var _reactLooselyLazy = require("react-loosely-lazy");
12
12
  var _spinner = _interopRequireDefault(require("@atlaskit/spinner"));
13
13
  var _ShareFormWrapper = require("../ShareFormWrapper");
14
14
  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); }
15
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || (0, _typeof2.default)(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; }
15
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || (0, _typeof2.default)(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; } /** @jsx jsx */
16
16
  var LazyShareFormLazy = (0, _reactLooselyLazy.lazyForPaint)(function () {
17
17
  return Promise.resolve().then(function () {
18
- return _interopRequireWildcard(require('./LazyShareForm'));
18
+ return _interopRequireWildcard(require( /* webpackChunkName: "@atlaskit-internal_share-form" */
19
+ './LazyShareForm'));
19
20
  });
20
21
  }, {
21
22
  ssr: false
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
6
6
  });
7
7
  exports.defaultConfig = exports.ShareDialogContainerInternal = exports.ShareDialogContainer = void 0;
8
8
  var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
9
+ var _objectDestructuringEmpty2 = _interopRequireDefault(require("@babel/runtime/helpers/objectDestructuringEmpty"));
9
10
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
10
11
  var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
11
12
  var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
@@ -76,44 +77,42 @@ var ShareDialogContainerInternal = /*#__PURE__*/function (_React$Component) {
76
77
  }, /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
77
78
  var config, errObj;
78
79
  return _regenerator.default.wrap(function _callee$(_context) {
79
- while (1) {
80
- switch (_context.prev = _context.next) {
81
- case 0:
82
- _context.prev = 0;
83
- _ufoExperiences.renderShareDialogExp.start();
84
- _context.next = 4;
85
- return _this.shareClient.getConfig(_this.props.cloudId);
86
- case 4:
87
- config = _context.sent;
88
- if (_this._isMounted) {
89
- _this.setState({
90
- config: config,
91
- isFetchingConfig: false
92
- });
93
- }
94
- _ufoExperiences.renderShareDialogExp.success();
95
- _context.next = 15;
96
- break;
97
- case 9:
98
- _context.prev = 9;
99
- _context.t0 = _context["catch"](0);
100
- if (_this._isMounted) {
101
- _this.setState({
102
- config: defaultConfig,
103
- isFetchingConfig: false
104
- });
105
- }
106
- errObj = (0, _extends2.default)({}, _context.t0);
107
- if (_context.t0 instanceof Error) {
108
- errObj = _objectSpread(_objectSpread({}, errObj), {}, {
109
- className: _context.t0.constructor.name
110
- });
111
- }
112
- (0, _ufoExperienceHelper.isValidFailedExperience)(_ufoExperiences.renderShareDialogExp, errObj);
113
- case 15:
114
- case "end":
115
- return _context.stop();
116
- }
80
+ while (1) switch (_context.prev = _context.next) {
81
+ case 0:
82
+ _context.prev = 0;
83
+ _ufoExperiences.renderShareDialogExp.start();
84
+ _context.next = 4;
85
+ return _this.shareClient.getConfig(_this.props.cloudId);
86
+ case 4:
87
+ config = _context.sent;
88
+ if (_this._isMounted) {
89
+ _this.setState({
90
+ config: config,
91
+ isFetchingConfig: false
92
+ });
93
+ }
94
+ _ufoExperiences.renderShareDialogExp.success();
95
+ _context.next = 15;
96
+ break;
97
+ case 9:
98
+ _context.prev = 9;
99
+ _context.t0 = _context["catch"](0);
100
+ if (_this._isMounted) {
101
+ _this.setState({
102
+ config: defaultConfig,
103
+ isFetchingConfig: false
104
+ });
105
+ }
106
+ errObj = (0, _extends2.default)({}, ((0, _objectDestructuringEmpty2.default)(_context.t0), _context.t0));
107
+ if (_context.t0 instanceof Error) {
108
+ errObj = _objectSpread(_objectSpread({}, errObj), {}, {
109
+ className: _context.t0.constructor.name
110
+ });
111
+ }
112
+ (0, _ufoExperienceHelper.isValidFailedExperience)(_ufoExperiences.renderShareDialogExp, errObj);
113
+ case 15:
114
+ case "end":
115
+ return _context.stop();
117
116
  }
118
117
  }, _callee, null, [[0, 9]]);
119
118
  })));
@@ -154,24 +153,22 @@ var ShareDialogContainerInternal = /*#__PURE__*/function (_React$Component) {
154
153
  });
155
154
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "handleDialogOpen", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2() {
156
155
  return _regenerator.default.wrap(function _callee2$(_context2) {
157
- while (1) {
158
- switch (_context2.prev = _context2.next) {
159
- case 0:
160
- if (_this.props.onDialogOpen) {
161
- _this.props.onDialogOpen();
162
- }
163
- _this.setState({
164
- currentPageUrl: getCurrentPageUrl()
165
- }, function () {
166
- _this.updateShortCopyLink();
167
- });
156
+ while (1) switch (_context2.prev = _context2.next) {
157
+ case 0:
158
+ if (_this.props.onDialogOpen) {
159
+ _this.props.onDialogOpen();
160
+ }
161
+ _this.setState({
162
+ currentPageUrl: getCurrentPageUrl()
163
+ }, function () {
164
+ _this.updateShortCopyLink();
165
+ });
168
166
 
169
- // always refetch the config when modal is re-opened
170
- _this.fetchConfig();
171
- case 3:
172
- case "end":
173
- return _context2.stop();
174
- }
167
+ // always refetch the config when modal is re-opened
168
+ _this.fetchConfig();
169
+ case 3:
170
+ case "end":
171
+ return _context2.stop();
175
172
  }
176
173
  }, _callee2);
177
174
  })));
@@ -189,9 +186,12 @@ var ShareDialogContainerInternal = /*#__PURE__*/function (_React$Component) {
189
186
  }
190
187
  return payload;
191
188
  });
189
+ // ensure origin is re-generated if the link or the factory changes
190
+ // separate memoization is needed since copy != form
192
191
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "getUniqueCopyLinkOriginTracing", (0, _memoizeOne.default)(function (link, originTracingFactory) {
193
192
  return originTracingFactory();
194
193
  }));
194
+ // form origin must furthermore be regenerated after each form share
195
195
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "getUniqueFormShareOriginTracing", (0, _memoizeOne.default)(function (link, originTracingFactory, shareCount) {
196
196
  return originTracingFactory();
197
197
  }));
@@ -33,6 +33,8 @@ var _ShareButton = _interopRequireDefault(require("./ShareButton"));
33
33
  var _SplitButton = _interopRequireDefault(require("./SplitButton"));
34
34
  var _utils = require("./utils");
35
35
  var _templateObject;
36
+ /** @jsx jsx */
37
+ // eslint-disable-next-line no-duplicate-imports
36
38
  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; }
37
39
  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) { (0, _defineProperty2.default)(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; }
38
40
  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); }; }
@@ -58,6 +60,11 @@ var ShareDialogWithTriggerInternal = /*#__PURE__*/function (_React$PureComponent
58
60
  }
59
61
  _this = _super.call.apply(_super, [this].concat(args));
60
62
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "containerRef", /*#__PURE__*/_react.default.createRef());
63
+ /**
64
+ * Because the PopUp component has a higher zIndex it causes
65
+ * the select to be rendered within it, and add scrollbars.
66
+ * We will render the select options the PopUp outside,
67
+ */
61
68
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "selectPortalRef", /*#__PURE__*/_react.default.createRef());
62
69
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "start", 0);
63
70
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "state", {
@@ -35,6 +35,7 @@ var _IntegrationForm = require("./IntegrationForm");
35
35
  var _ShareHeader = require("./ShareHeader");
36
36
  var _UserPickerField = require("./UserPickerField");
37
37
  var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7;
38
+ /** @jsx jsx */
38
39
  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); }
39
40
  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; }
40
41
  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; }
@@ -13,6 +13,7 @@ var _constants = require("@atlaskit/theme/constants");
13
13
  var _typography = require("@atlaskit/theme/typography");
14
14
  var _i18n = require("../i18n");
15
15
  var _templateObject, _templateObject2;
16
+ /** @jsx jsx */
16
17
  var headerWrapperStyles = (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n justify-content: space-between;\n"])));
17
18
  var getFormHeaderTitleStyles = function getFormHeaderTitleStyles(theme) {
18
19
  return (0, _react2.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n ", "\n line-height: ", "px;\n margin-right: ", "px;\n margin-top: ", "px;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n\n > span {\n font-size: initial;\n }\n"])), (0, _typography.h500)(theme), (0, _constants.gridSize)() * 4, (0, _constants.gridSize)() * 4, (0, _constants.gridSize)() * 4);
@@ -22,6 +22,7 @@ var _analytics = require("./analytics/analytics");
22
22
  var _IntegrationButton = _interopRequireDefault(require("./IntegrationButton"));
23
23
  var _excluded = ["triggerRef"];
24
24
  var _templateObject, _templateObject2, _templateObject3;
25
+ /** @jsx jsx */
25
26
  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); }
26
27
  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; }
27
28
  var splitButtonWrapperStyles = (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n button {\n border-radius: ", "px 0 0 ", "px;\n }\n button:hover {\n border-radius: ", "px 0 0 ", "px;\n }\n"])), (0, _constants.borderRadius)(), (0, _constants.borderRadius)(), (0, _constants.borderRadius)(), (0, _constants.borderRadius)());
@@ -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.1.0"
16
+ packageVersion: "4.2.0"
17
17
  }, attributes);
18
18
  };
19
19
  var createEvent = function createEvent(eventType, source, action, actionSubject, actionSubjectId) {
@@ -5,6 +5,9 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.zIndexAddition = exports.resolveShareFooter = exports.optionDataToUsers = exports.getMenuPortalTargetCurrentHTML = exports.generateSelectZIndex = exports.allowEmails = void 0;
7
7
  var _constants = require("@atlaskit/theme/constants");
8
+ // AFP-2532 TODO: Fix automatic suppressions below
9
+ // eslint-disable-next-line @atlassian/tangerine/import/entry-points
10
+
8
11
  /**
9
12
  * We need to generate correct zIndex, for the PopUp and for the Select inside it.
10
13
  * The PopUp's defaults to `layers.layer()` from @atlaskit/theme. But if user provides
@@ -5,9 +5,9 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.TabType = void 0;
7
7
  // Third party integrations
8
- var TabType;
9
- exports.TabType = TabType;
10
- (function (TabType) {
8
+ var TabType = /*#__PURE__*/function (TabType) {
11
9
  TabType[TabType["default"] = 0] = "default";
12
10
  TabType[TabType["Slack"] = 1] = "Slack";
13
- })(TabType || (exports.TabType = TabType = {}));
11
+ return TabType;
12
+ }({});
13
+ exports.TabType = TabType;
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "name": "@atlaskit/share",
3
- "version": "4.1.0"
3
+ "version": "4.2.0"
4
4
  }
@@ -142,9 +142,12 @@ export class ShareDialogContainerInternal extends React.Component {
142
142
  }
143
143
  return payload;
144
144
  });
145
+ // ensure origin is re-generated if the link or the factory changes
146
+ // separate memoization is needed since copy != form
145
147
  _defineProperty(this, "getUniqueCopyLinkOriginTracing", memoizeOne((link, originTracingFactory) => {
146
148
  return originTracingFactory();
147
149
  }));
150
+ // form origin must furthermore be regenerated after each form share
148
151
  _defineProperty(this, "getUniqueFormShareOriginTracing", memoizeOne((link, originTracingFactory, shareCount) => {
149
152
  return originTracingFactory();
150
153
  }));
@@ -39,6 +39,11 @@ export class ShareDialogWithTriggerInternal extends React.PureComponent {
39
39
  constructor(...args) {
40
40
  super(...args);
41
41
  _defineProperty(this, "containerRef", /*#__PURE__*/React.createRef());
42
+ /**
43
+ * Because the PopUp component has a higher zIndex it causes
44
+ * the select to be rendered within it, and add scrollbars.
45
+ * We will render the select options the PopUp outside,
46
+ */
42
47
  _defineProperty(this, "selectPortalRef", /*#__PURE__*/React.createRef());
43
48
  _defineProperty(this, "start", 0);
44
49
  _defineProperty(this, "state", {
@@ -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.1.0",
4
+ packageVersion: "4.2.0",
5
5
  ...attributes
6
6
  });
7
7
  const createEvent = (eventType, source, action, actionSubject, actionSubjectId, attributes = {}) => ({
@@ -2,7 +2,6 @@ import { layers } from '@atlaskit/theme/constants';
2
2
 
3
3
  // AFP-2532 TODO: Fix automatic suppressions below
4
4
  // eslint-disable-next-line @atlassian/tangerine/import/entry-points
5
-
6
5
  /**
7
6
  * We need to generate correct zIndex, for the PopUp and for the Select inside it.
8
7
  * The PopUp's defaults to `layers.layer()` from @atlaskit/theme. But if user provides
@@ -1,7 +1,7 @@
1
1
  // Third party integrations
2
2
 
3
- export let TabType;
4
- (function (TabType) {
3
+ export let TabType = /*#__PURE__*/function (TabType) {
5
4
  TabType[TabType["default"] = 0] = "default";
6
5
  TabType[TabType["Slack"] = 1] = "Slack";
7
- })(TabType || (TabType = {}));
6
+ return TabType;
7
+ }({});
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "name": "@atlaskit/share",
3
- "version": "4.1.0"
3
+ "version": "4.2.0"
4
4
  }
@@ -12,48 +12,46 @@ export var AtlassianUrlShortenerClient = /*#__PURE__*/function () {
12
12
  var _shorten = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(data) {
13
13
  var response, result;
14
14
  return _regeneratorRuntime.wrap(function _callee$(_context) {
15
- while (1) {
16
- switch (_context.prev = _context.next) {
17
- case 0:
18
- _context.prev = 0;
19
- _context.next = 3;
20
- return fetch('/gateway/api/atl-link/create', {
21
- method: 'POST',
22
- headers: {
23
- 'Content-Type': 'application/json'
24
- },
25
- body: JSON.stringify(data)
26
- });
27
- case 3:
28
- response = _context.sent;
29
- if (response.ok) {
30
- _context.next = 6;
31
- break;
32
- }
33
- throw new Error("status=\"".concat(response.status, "\""));
34
- case 6:
35
- _context.next = 8;
36
- return response.json();
37
- case 8:
38
- result = _context.sent;
39
- if (result.shortUrl) {
40
- _context.next = 11;
41
- break;
42
- }
43
- throw new Error('Breach of contract!');
44
- case 11:
45
- return _context.abrupt("return", result);
46
- case 14:
47
- _context.prev = 14;
48
- _context.t0 = _context["catch"](0);
49
- if (_context.t0 instanceof Error) {
50
- _context.t0.message = "While shortening URL: ".concat(_context.t0.message, "!");
51
- }
52
- throw _context.t0;
53
- case 18:
54
- case "end":
55
- return _context.stop();
56
- }
15
+ while (1) switch (_context.prev = _context.next) {
16
+ case 0:
17
+ _context.prev = 0;
18
+ _context.next = 3;
19
+ return fetch('/gateway/api/atl-link/create', {
20
+ method: 'POST',
21
+ headers: {
22
+ 'Content-Type': 'application/json'
23
+ },
24
+ body: JSON.stringify(data)
25
+ });
26
+ case 3:
27
+ response = _context.sent;
28
+ if (response.ok) {
29
+ _context.next = 6;
30
+ break;
31
+ }
32
+ throw new Error("status=\"".concat(response.status, "\""));
33
+ case 6:
34
+ _context.next = 8;
35
+ return response.json();
36
+ case 8:
37
+ result = _context.sent;
38
+ if (result.shortUrl) {
39
+ _context.next = 11;
40
+ break;
41
+ }
42
+ throw new Error('Breach of contract!');
43
+ case 11:
44
+ return _context.abrupt("return", result);
45
+ case 14:
46
+ _context.prev = 14;
47
+ _context.t0 = _context["catch"](0);
48
+ if (_context.t0 instanceof Error) {
49
+ _context.t0.message = "While shortening URL: ".concat(_context.t0.message, "!");
50
+ }
51
+ throw _context.t0;
52
+ case 18:
53
+ case "end":
54
+ return _context.stop();
57
55
  }
58
56
  }, _callee, null, [[0, 14]]);
59
57
  }));
@@ -1,3 +1,4 @@
1
+ import _objectDestructuringEmpty from "@babel/runtime/helpers/objectDestructuringEmpty";
1
2
  import _extends from "@babel/runtime/helpers/extends";
2
3
  import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
3
4
  import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
@@ -68,44 +69,42 @@ export var ShareDialogContainerInternal = /*#__PURE__*/function (_React$Componen
68
69
  }, /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
69
70
  var config, errObj;
70
71
  return _regeneratorRuntime.wrap(function _callee$(_context) {
71
- while (1) {
72
- switch (_context.prev = _context.next) {
73
- case 0:
74
- _context.prev = 0;
75
- renderShareDialogExp.start();
76
- _context.next = 4;
77
- return _this.shareClient.getConfig(_this.props.cloudId);
78
- case 4:
79
- config = _context.sent;
80
- if (_this._isMounted) {
81
- _this.setState({
82
- config: config,
83
- isFetchingConfig: false
84
- });
85
- }
86
- renderShareDialogExp.success();
87
- _context.next = 15;
88
- break;
89
- case 9:
90
- _context.prev = 9;
91
- _context.t0 = _context["catch"](0);
92
- if (_this._isMounted) {
93
- _this.setState({
94
- config: defaultConfig,
95
- isFetchingConfig: false
96
- });
97
- }
98
- errObj = _extends({}, _context.t0);
99
- if (_context.t0 instanceof Error) {
100
- errObj = _objectSpread(_objectSpread({}, errObj), {}, {
101
- className: _context.t0.constructor.name
102
- });
103
- }
104
- isValidFailedExperience(renderShareDialogExp, errObj);
105
- case 15:
106
- case "end":
107
- return _context.stop();
108
- }
72
+ while (1) switch (_context.prev = _context.next) {
73
+ case 0:
74
+ _context.prev = 0;
75
+ renderShareDialogExp.start();
76
+ _context.next = 4;
77
+ return _this.shareClient.getConfig(_this.props.cloudId);
78
+ case 4:
79
+ config = _context.sent;
80
+ if (_this._isMounted) {
81
+ _this.setState({
82
+ config: config,
83
+ isFetchingConfig: false
84
+ });
85
+ }
86
+ renderShareDialogExp.success();
87
+ _context.next = 15;
88
+ break;
89
+ case 9:
90
+ _context.prev = 9;
91
+ _context.t0 = _context["catch"](0);
92
+ if (_this._isMounted) {
93
+ _this.setState({
94
+ config: defaultConfig,
95
+ isFetchingConfig: false
96
+ });
97
+ }
98
+ errObj = _extends({}, (_objectDestructuringEmpty(_context.t0), _context.t0));
99
+ if (_context.t0 instanceof Error) {
100
+ errObj = _objectSpread(_objectSpread({}, errObj), {}, {
101
+ className: _context.t0.constructor.name
102
+ });
103
+ }
104
+ isValidFailedExperience(renderShareDialogExp, errObj);
105
+ case 15:
106
+ case "end":
107
+ return _context.stop();
109
108
  }
110
109
  }, _callee, null, [[0, 9]]);
111
110
  })));
@@ -146,24 +145,22 @@ export var ShareDialogContainerInternal = /*#__PURE__*/function (_React$Componen
146
145
  });
147
146
  _defineProperty(_assertThisInitialized(_this), "handleDialogOpen", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
148
147
  return _regeneratorRuntime.wrap(function _callee2$(_context2) {
149
- while (1) {
150
- switch (_context2.prev = _context2.next) {
151
- case 0:
152
- if (_this.props.onDialogOpen) {
153
- _this.props.onDialogOpen();
154
- }
155
- _this.setState({
156
- currentPageUrl: getCurrentPageUrl()
157
- }, function () {
158
- _this.updateShortCopyLink();
159
- });
148
+ while (1) switch (_context2.prev = _context2.next) {
149
+ case 0:
150
+ if (_this.props.onDialogOpen) {
151
+ _this.props.onDialogOpen();
152
+ }
153
+ _this.setState({
154
+ currentPageUrl: getCurrentPageUrl()
155
+ }, function () {
156
+ _this.updateShortCopyLink();
157
+ });
160
158
 
161
- // always refetch the config when modal is re-opened
162
- _this.fetchConfig();
163
- case 3:
164
- case "end":
165
- return _context2.stop();
166
- }
159
+ // always refetch the config when modal is re-opened
160
+ _this.fetchConfig();
161
+ case 3:
162
+ case "end":
163
+ return _context2.stop();
167
164
  }
168
165
  }, _callee2);
169
166
  })));
@@ -181,9 +178,12 @@ export var ShareDialogContainerInternal = /*#__PURE__*/function (_React$Componen
181
178
  }
182
179
  return payload;
183
180
  });
181
+ // ensure origin is re-generated if the link or the factory changes
182
+ // separate memoization is needed since copy != form
184
183
  _defineProperty(_assertThisInitialized(_this), "getUniqueCopyLinkOriginTracing", memoizeOne(function (link, originTracingFactory) {
185
184
  return originTracingFactory();
186
185
  }));
186
+ // form origin must furthermore be regenerated after each form share
187
187
  _defineProperty(_assertThisInitialized(_this), "getUniqueFormShareOriginTracing", memoizeOne(function (link, originTracingFactory, shareCount) {
188
188
  return originTracingFactory();
189
189
  }));
@@ -55,6 +55,11 @@ export var ShareDialogWithTriggerInternal = /*#__PURE__*/function (_React$PureCo
55
55
  }
56
56
  _this = _super.call.apply(_super, [this].concat(args));
57
57
  _defineProperty(_assertThisInitialized(_this), "containerRef", /*#__PURE__*/React.createRef());
58
+ /**
59
+ * Because the PopUp component has a higher zIndex it causes
60
+ * the select to be rendered within it, and add scrollbars.
61
+ * We will render the select options the PopUp outside,
62
+ */
58
63
  _defineProperty(_assertThisInitialized(_this), "selectPortalRef", /*#__PURE__*/React.createRef());
59
64
  _defineProperty(_assertThisInitialized(_this), "start", 0);
60
65
  _defineProperty(_assertThisInitialized(_this), "state", {
@@ -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.1.0"
9
+ packageVersion: "4.2.0"
10
10
  }, attributes);
11
11
  };
12
12
  var createEvent = function createEvent(eventType, source, action, actionSubject, actionSubjectId) {
@@ -2,7 +2,6 @@ import { layers } from '@atlaskit/theme/constants';
2
2
 
3
3
  // AFP-2532 TODO: Fix automatic suppressions below
4
4
  // eslint-disable-next-line @atlassian/tangerine/import/entry-points
5
-
6
5
  /**
7
6
  * We need to generate correct zIndex, for the PopUp and for the Select inside it.
8
7
  * The PopUp's defaults to `layers.layer()` from @atlaskit/theme. But if user provides
@@ -1,7 +1,7 @@
1
1
  // Third party integrations
2
2
 
3
- export var TabType;
4
- (function (TabType) {
3
+ export var TabType = /*#__PURE__*/function (TabType) {
5
4
  TabType[TabType["default"] = 0] = "default";
6
5
  TabType[TabType["Slack"] = 1] = "Slack";
7
- })(TabType || (TabType = {}));
6
+ return TabType;
7
+ }({});
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "name": "@atlaskit/share",
3
- "version": "4.1.0"
3
+ "version": "4.2.0"
4
4
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/share",
3
- "version": "4.1.0",
3
+ "version": "4.2.0",
4
4
  "description": "Fabric Share Element",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -30,23 +30,23 @@
30
30
  "access": "private"
31
31
  },
32
32
  "dependencies": {
33
- "@atlaskit/analytics-next": "^9.0.0",
34
- "@atlaskit/button": "^16.5.0",
35
- "@atlaskit/dropdown-menu": "^11.7.0",
36
- "@atlaskit/form": "^8.8.0",
37
- "@atlaskit/icon": "^21.11.0",
38
- "@atlaskit/popup": "^1.5.0",
39
- "@atlaskit/portal": "^4.0.0",
40
- "@atlaskit/smart-user-picker": "^6.0.0",
41
- "@atlaskit/spinner": "^15.4.0",
42
- "@atlaskit/tabs": "^13.3.0",
43
- "@atlaskit/textarea": "^4.5.0",
44
- "@atlaskit/theme": "^12.2.0",
45
- "@atlaskit/tokens": "^1.2.0",
46
- "@atlaskit/tooltip": "^17.7.0",
47
- "@atlaskit/ufo": "^0.1.0",
48
- "@atlaskit/user-picker": "^10.1.0",
49
- "@atlaskit/util-service-support": "^6.1.0",
33
+ "@atlaskit/analytics-next": "^9.1.0",
34
+ "@atlaskit/button": "^16.7.0",
35
+ "@atlaskit/dropdown-menu": "^11.8.0",
36
+ "@atlaskit/form": "^8.11.0",
37
+ "@atlaskit/icon": "^21.12.0",
38
+ "@atlaskit/popup": "^1.6.0",
39
+ "@atlaskit/portal": "^4.3.0",
40
+ "@atlaskit/smart-user-picker": "^6.1.0",
41
+ "@atlaskit/spinner": "^15.5.0",
42
+ "@atlaskit/tabs": "^13.4.0",
43
+ "@atlaskit/textarea": "^4.6.0",
44
+ "@atlaskit/theme": "^12.5.0",
45
+ "@atlaskit/tokens": "^1.3.0",
46
+ "@atlaskit/tooltip": "^17.8.0",
47
+ "@atlaskit/ufo": "^0.2.0",
48
+ "@atlaskit/user-picker": "^10.2.0",
49
+ "@atlaskit/util-service-support": "^6.2.0",
50
50
  "@babel/runtime": "^7.0.0",
51
51
  "@emotion/react": "^11.7.1",
52
52
  "@react-loosely-lazy/manifest": "^1.0.0",
@@ -60,13 +60,13 @@
60
60
  "react": "^16.8.0"
61
61
  },
62
62
  "devDependencies": {
63
- "@atlaskit/docs": "^9.0.0",
64
- "@atlaskit/editor-test-helpers": "^18.0.0",
65
- "@atlaskit/flag": "^15.0.0",
66
- "@atlaskit/section-message": "^6.3.0",
67
- "@atlaskit/select": "^16.1.0",
68
- "@atlaskit/toggle": "^12.5.0",
69
- "@atlaskit/util-data-test": "^17.6.0",
63
+ "@atlaskit/docs": "^9.1.0",
64
+ "@atlaskit/editor-test-helpers": "^18.2.0",
65
+ "@atlaskit/flag": "^15.2.0",
66
+ "@atlaskit/section-message": "^6.4.0",
67
+ "@atlaskit/select": "^16.2.0",
68
+ "@atlaskit/toggle": "^12.6.0",
69
+ "@atlaskit/util-data-test": "^17.8.0",
70
70
  "@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",
71
71
  "enzyme": "^3.10.0",
72
72
  "enzyme-adapter-react-16": "^1.15.1",
@@ -1,319 +0,0 @@
1
- ## API Report File for "@atlaskit/share"
2
-
3
- > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
4
-
5
- ```ts
6
-
7
- /// <reference types="react" />
8
-
9
- import type { Appearance } from '@atlaskit/button/types';
10
- import type { IconProps } from '@atlaskit/icon';
11
- import { jsx } from '@emotion/react';
12
- import type { LoadOptions } from '@atlaskit/smart-user-picker';
13
- import { OptionData } from '@atlaskit/smart-user-picker';
14
- import type { Placement } from '@atlaskit/popper';
15
- import { default as React_2 } from 'react';
16
- import { ReactElement } from 'react';
17
- import { TriggerProps } from '@atlaskit/popup';
18
- import type { Value } from '@atlaskit/smart-user-picker';
19
- import { WithAnalyticsEventsProps } from '@atlaskit/analytics-next';
20
-
21
- // @public (undocumented)
22
- export const ADMIN_NOTIFIED = "admin-notified";
23
-
24
- // @public (undocumented)
25
- type Comment_2 = {
26
- format: 'adf' | 'plain_text';
27
- value: string;
28
- };
29
- export { Comment_2 as Comment }
30
-
31
- // @public (undocumented)
32
- export type ConfigResponse = {
33
- disableSharingToEmails?: boolean;
34
- };
35
-
36
- // @public (undocumented)
37
- export type Content = {
38
- ari: string;
39
- link: string;
40
- title: string;
41
- type: string;
42
- };
43
-
44
- // @public (undocumented)
45
- export class CopyLinkButton extends React_2.Component<Props, State> {
46
- // (undocumented)
47
- componentWillUnmount(): void;
48
- // (undocumented)
49
- render(): jsx.JSX.Element;
50
- // (undocumented)
51
- renderTriggerButton: (triggerProps: TriggerProps) => jsx.JSX.Element;
52
- // (undocumented)
53
- state: {
54
- shouldShowCopiedMessage: boolean;
55
- };
56
- }
57
-
58
- // @public (undocumented)
59
- export type DialogContentState = {
60
- users: OptionData[];
61
- comment: Comment_2;
62
- };
63
-
64
- // @public (undocumented)
65
- export type DialogPlacement = Placement;
66
-
67
- // @public (undocumented)
68
- export type Flag = {
69
- appearance: 'success';
70
- title: MessageDescriptor;
71
- type: FlagType;
72
- };
73
-
74
- // @public (undocumented)
75
- export type FlagType = 'admin-notified' | 'object-shared';
76
-
77
- // @public (undocumented)
78
- export type FormChildrenArgs<T> = {
79
- formProps: React.DetailedHTMLProps<React.FormHTMLAttributes<HTMLFormElement>, HTMLFormElement>;
80
- getValues: () => T;
81
- };
82
-
83
- // @public (undocumented)
84
- type Integration = {
85
- type: string;
86
- Icon: React.ComponentType;
87
- Content: React.ComponentType<IntegrationContentProps>;
88
- };
89
-
90
- // @public (undocumented)
91
- type IntegrationContentProps = {
92
- onClose: () => void;
93
- changeTab?: (index: TabType) => void;
94
- };
95
-
96
- // @public (undocumented)
97
- type IntegrationMode = 'off' | 'split' | 'tabs';
98
-
99
- // @public (undocumented)
100
- export type KeysOfType<T, TProp> = {
101
- [P in keyof T]: T[P] extends TProp ? P : never;
102
- }[keyof T];
103
-
104
- // @public (undocumented)
105
- export type MessageDescriptor = {
106
- id: string;
107
- description: string;
108
- defaultMessage: string;
109
- };
110
-
111
- // @public (undocumented)
112
- export type MetaData = {
113
- productId: string;
114
- atlOriginId: string;
115
- shareeAction?: 'edit' | 'view';
116
- };
117
-
118
- // @public (undocumented)
119
- export const OBJECT_SHARED = "object-shared";
120
-
121
- // @public (undocumented)
122
- export type OriginAnalyticAttributes = {
123
- hasGeneratedId: boolean;
124
- };
125
-
126
- // @public (undocumented)
127
- export type OriginTracing = {
128
- id: string;
129
- addToUrl: (link: string) => string;
130
- toAnalyticsAttributes: (attrs: OriginAnalyticAttributes) => OriginTracingForSubSequentEvents | OriginTracingWithIdGenerated;
131
- };
132
-
133
- // @public (undocumented)
134
- export type OriginTracingFactory = () => OriginTracing;
135
-
136
- // @public (undocumented)
137
- export type OriginTracingForSubSequentEvents = {
138
- originId: string;
139
- originProduct: string;
140
- };
141
-
142
- // @public (undocumented)
143
- export type OriginTracingWithIdGenerated = {
144
- originIdGenerated: string;
145
- originProduct: string;
146
- };
147
-
148
- // @public
149
- export type ProductId = 'bitbucket' | 'confluence' | 'jira-addon' | 'jira-core' | 'jira-platform' | 'jira-polaris' | 'jira-portfolio' | 'jira-servicedesk' | 'jira-software' | 'jira-unknown' | 'trello';
150
-
151
- // @public (undocumented)
152
- export type ProductName = 'confluence' | 'jira';
153
-
154
- // @public (undocumented)
155
- type Props = {
156
- onLinkCopy?: (link: string) => void;
157
- link: string;
158
- isDisabled?: boolean;
159
- copyTooltipText?: string;
160
- children?: ReactElement | string;
161
- copyLinkButtonText: string;
162
- copiedToClipboardText: string;
163
- iconBefore?: ReactElement;
164
- };
165
-
166
- // @public (undocumented)
167
- export type RenderCustomTriggerButton = (args: {
168
- error?: ShareError;
169
- isDisabled?: boolean;
170
- isSelected?: boolean;
171
- onClick: () => void;
172
- }, triggerProps: TriggerProps) => React.ReactNode;
173
-
174
- // @public (undocumented)
175
- export type ShareButtonStyle = 'icon-only' | 'icon-with-text' | 'text-only';
176
-
177
- // @public (undocumented)
178
- interface ShareClient {
179
- // (undocumented)
180
- getConfig(cloudId: string): Promise<ConfigResponse>;
181
- // (undocumented)
182
- share(content: Content, recipients: User[], metadata: MetaData, comment?: Comment_2): Promise<ShareResponse>;
183
- }
184
-
185
- // @public (undocumented)
186
- export type ShareContentState = {
187
- users: User[];
188
- comment?: Comment_2;
189
- };
190
-
191
- // @public (undocumented)
192
- export const ShareDialogContainer: React_2.ForwardRefExoticComponent<Pick<Omit<WithAnalyticsEventsProps & ShareDialogContainerProps, keyof WithAnalyticsEventsProps>, "bottomMessage" | "cloudId" | "copyTooltipText" | "customFooter" | "dialogPlacement" | "dialogZIndex" | "formatCopyLink" | "integrationMode" | "isAutoOpenDialog" | "isBrowseUsersDisabled" | "isCopyDisabled" | "isPublicLink" | "loadUserOptions" | "loggedInAccountId" | "onDialogClose" | "onDialogOpen" | "onTriggerButtonClick" | "onUserSelectionChange" | "orgId" | "originTracingFactory" | "productId" | "renderCustomTriggerButton" | "shareAri" | "shareClient" | "shareContentType" | "shareFieldsFooter" | "shareFormHelperMessage" | "shareFormTitle" | "shareIntegrations" | "shareLink" | "shareTitle" | "shortLinkData" | "shouldCloseOnEscapePress" | "showFlags" | "tabIndex" | "triggerButtonAppearance" | "triggerButtonIcon" | "triggerButtonStyle" | "triggerButtonTooltipPosition" | "triggerButtonTooltipText" | "urlShortenerClient" | "useUrlShortener"> & Partial<Pick<Omit<WithAnalyticsEventsProps & ShareDialogContainerProps, keyof WithAnalyticsEventsProps>, "enableSmartUserPicker" | "product" | "shareeAction">> & Partial<Pick<{
193
- enableSmartUserPicker: boolean;
194
- shareeAction: "edit" | "view";
195
- product: string;
196
- }, never>> & React_2.RefAttributes<any>>;
197
-
198
- // @public (undocumented)
199
- export type ShareDialogContainerProps = {
200
- onTriggerButtonClick?: () => void;
201
- onDialogOpen?: () => void;
202
- onDialogClose?: () => void;
203
- isAutoOpenDialog?: boolean;
204
- shareClient?: ShareClient;
205
- urlShortenerClient?: UrlShortenerClient;
206
- shortLinkData?: ShortenRequest;
207
- cloudId: string;
208
- orgId?: string;
209
- dialogPlacement?: DialogPlacement;
210
- dialogZIndex?: number;
211
- formatCopyLink?: (origin: OriginTracing, link: string) => string;
212
- loadUserOptions?: LoadOptions;
213
- originTracingFactory: OriginTracingFactory;
214
- productId: ProductId;
215
- renderCustomTriggerButton?: RenderCustomTriggerButton;
216
- shareAri: string;
217
- shareContentType: string;
218
- shareLink?: string;
219
- shareTitle: string;
220
- shareFormTitle?: React.ReactNode;
221
- shareFormHelperMessage?: string;
222
- shouldCloseOnEscapePress?: boolean;
223
- showFlags: (flags: Array<Flag>) => void;
224
- enableSmartUserPicker?: boolean;
225
- loggedInAccountId?: string;
226
- triggerButtonAppearance?: Appearance;
227
- triggerButtonIcon?: React.ComponentType<IconProps>;
228
- triggerButtonStyle?: ShareButtonStyle;
229
- triggerButtonTooltipPosition?: TooltipPosition;
230
- triggerButtonTooltipText?: React.ReactNode;
231
- bottomMessage?: React.ReactNode;
232
- useUrlShortener?: boolean;
233
- shareeAction?: 'edit' | 'view';
234
- product?: ProductName;
235
- customFooter?: React.ReactNode;
236
- onUserSelectionChange?: (value: Value) => void;
237
- shareFieldsFooter?: React.ReactNode;
238
- isCopyDisabled?: boolean;
239
- isPublicLink?: boolean;
240
- integrationMode?: IntegrationMode;
241
- shareIntegrations?: Array<Integration>;
242
- tabIndex?: number;
243
- copyTooltipText?: string;
244
- isBrowseUsersDisabled?: boolean;
245
- };
246
-
247
- // @public (undocumented)
248
- export type ShareError = {
249
- message: string;
250
- };
251
-
252
- // @public (undocumented)
253
- export type ShareRequest = (content: Content, recipients: User[], metadata: MetaData, comment?: Comment_2) => Promise<ShareResponse>;
254
-
255
- // @public (undocumented)
256
- export type ShareResponse = {
257
- shareRequestId: string;
258
- };
259
-
260
- // @public (undocumented)
261
- interface ShortenRequest {
262
- // (undocumented)
263
- cloudId?: string;
264
- // (undocumented)
265
- originId?: string;
266
- // (undocumented)
267
- params: Record<string, string>;
268
- // (undocumented)
269
- product: string;
270
- // (undocumented)
271
- type: string;
272
- }
273
-
274
- // @public (undocumented)
275
- interface ShortenResponse {
276
- // (undocumented)
277
- shortUrl: string;
278
- }
279
-
280
- // @public (undocumented)
281
- type State = {
282
- shouldShowCopiedMessage: boolean;
283
- };
284
-
285
- // @public (undocumented)
286
- enum TabType {
287
- // (undocumented)
288
- default = 0,
289
- // (undocumented)
290
- Slack = 1
291
- }
292
-
293
- // @public (undocumented)
294
- export type TooltipPosition = 'bottom' | 'left' | 'mouse' | 'right' | 'top';
295
-
296
- // @public (undocumented)
297
- interface UrlShortenerClient {
298
- // (undocumented)
299
- shorten(data: ShortenRequest): Promise<ShortenResponse>;
300
- }
301
-
302
- // @public (undocumented)
303
- export type User = UserWithEmail | UserWithId;
304
-
305
- // @public (undocumented)
306
- export type UserWithEmail = {
307
- type: 'user';
308
- email: string;
309
- };
310
-
311
- // @public (undocumented)
312
- export type UserWithId = {
313
- type: 'custom' | 'group' | 'team' | 'user';
314
- id: string;
315
- };
316
-
317
- // (No @packageDocumentation comment for this package)
318
-
319
- ```