@atlaskit/link-create 0.5.4 → 0.5.6

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 CHANGED
@@ -1,5 +1,17 @@
1
1
  # @atlaskit/link-create
2
2
 
3
+ ## 0.5.6
4
+
5
+ ### Patch Changes
6
+
7
+ - [`a02d619af5c`](https://bitbucket.org/atlassian/atlassian-frontend/commits/a02d619af5c) - Changed onCreate to return a possible Promise to hold the create button spinner while submitting
8
+
9
+ ## 0.5.5
10
+
11
+ ### Patch Changes
12
+
13
+ - [`7b5fb18bb63`](https://bitbucket.org/atlassian/atlassian-frontend/commits/7b5fb18bb63) - Update screen event to UI
14
+
3
15
  ## 0.5.4
4
16
 
5
17
  ### Patch Changes
@@ -49,8 +49,8 @@ events:
49
49
  <<: *PackageMetaDataContext
50
50
  <<: *LinkCreateAnalyticContext
51
51
 
52
- - linkCreateScreen closed:
53
- type: screen
52
+ - modalDialog closed (linkCreate):
53
+ type: ui
54
54
  description: fired when the link create component is unmounted/dismissed for any reason
55
55
  attributes:
56
56
  <<: *PackageMetaDataContext
@@ -11,7 +11,7 @@ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/sli
11
11
  *
12
12
  * Generates Typescript types for analytics events from analytics.spec.yaml
13
13
  *
14
- * @codegen <<SignedSource::1c6720e63161d16bb99fc183b17d1944>>
14
+ * @codegen <<SignedSource::6c4bc6f47b1cf9cb3a9a70cac9a93775>>
15
15
  * @codegenCommand yarn workspace @atlaskit/link-create run codegen-analytics
16
16
  */
17
17
 
@@ -6,6 +6,8 @@ Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
8
  exports.useLinkCreateCallback = exports.LinkCreateCallbackProvider = void 0;
9
+ var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
10
+ var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
9
11
  var _react = _interopRequireWildcard(require("react"));
10
12
  var _analyticsNext = require("@atlaskit/analytics-next");
11
13
  var _constants = require("../../common/constants");
@@ -22,15 +24,34 @@ var LinkCreateCallbackProvider = function LinkCreateCallbackProvider(_ref) {
22
24
  createAnalyticsEvent = _useAnalyticsEvents.createAnalyticsEvent;
23
25
  var value = (0, _react.useMemo)(function () {
24
26
  return {
25
- onCreate: function onCreate(result) {
26
- var objectId = result.objectId,
27
- objectType = result.objectType;
28
- createAnalyticsEvent((0, _analytics.default)('track.object.created.linkCreate', {
29
- objectId: objectId,
30
- objectType: objectType
31
- })).fire(_constants.ANALYTICS_CHANNEL);
32
- _onCreate && _onCreate(result);
33
- },
27
+ onCreate: function () {
28
+ var _onCreate2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(result) {
29
+ var objectId, objectType;
30
+ return _regenerator.default.wrap(function _callee$(_context) {
31
+ while (1) switch (_context.prev = _context.next) {
32
+ case 0:
33
+ objectId = result.objectId, objectType = result.objectType;
34
+ createAnalyticsEvent((0, _analytics.default)('track.object.created.linkCreate', {
35
+ objectId: objectId,
36
+ objectType: objectType
37
+ })).fire(_constants.ANALYTICS_CHANNEL);
38
+ if (!_onCreate) {
39
+ _context.next = 5;
40
+ break;
41
+ }
42
+ _context.next = 5;
43
+ return _onCreate(result);
44
+ case 5:
45
+ case "end":
46
+ return _context.stop();
47
+ }
48
+ }, _callee);
49
+ }));
50
+ function onCreate(_x) {
51
+ return _onCreate2.apply(this, arguments);
52
+ }
53
+ return onCreate;
54
+ }(),
34
55
  onFailure: onFailure,
35
56
  onCancel: onCancel
36
57
  };
@@ -69,7 +69,7 @@ var CreateForm = function CreateForm(_ref) {
69
69
  }
70
70
  return _context.abrupt("return", errors);
71
71
  case 5:
72
- onSubmit(data);
72
+ return _context.abrupt("return", onSubmit(data));
73
73
  case 6:
74
74
  case "end":
75
75
  return _context.stop();
@@ -108,8 +108,8 @@ var CreateForm = function CreateForm(_ref) {
108
108
  onClick: handleCancel,
109
109
  testId: 'close-button'
110
110
  }, intl.formatMessage(_messages.messages.close)), (0, _react2.jsx)(_loadingButton.default, {
111
- appearance: "primary",
112
111
  type: "submit",
112
+ appearance: "primary",
113
113
  isLoading: submitting,
114
114
  testId: 'create-button'
115
115
  }, intl.formatMessage(_messages.messages.create)))));
@@ -6,8 +6,10 @@ Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
8
  exports.default = exports.PACKAGE_DATA = void 0;
9
+ var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
9
10
  var _objectDestructuringEmpty2 = _interopRequireDefault(require("@babel/runtime/helpers/objectDestructuringEmpty"));
10
11
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
12
+ var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
11
13
  var _react = require("react");
12
14
  var _react2 = require("@emotion/react");
13
15
  var _reactIntlNext = require("react-intl-next");
@@ -39,11 +41,29 @@ var LinkCreate = function LinkCreate(_ref) {
39
41
  if (!chosenOne) {
40
42
  throw new Error('Make sure you specified a valid entityKey');
41
43
  }
42
- var handleCreate = (0, _react.useCallback)(function (result) {
43
- // Reset the form error message
44
- setFormErrorMessage(undefined);
45
- onCreate && onCreate(result.url);
46
- }, [onCreate, setFormErrorMessage]);
44
+ var handleCreate = (0, _react.useCallback)( /*#__PURE__*/function () {
45
+ var _ref2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(result) {
46
+ return _regenerator.default.wrap(function _callee$(_context) {
47
+ while (1) switch (_context.prev = _context.next) {
48
+ case 0:
49
+ // Reset the form error message
50
+ setFormErrorMessage(undefined);
51
+ if (!onCreate) {
52
+ _context.next = 4;
53
+ break;
54
+ }
55
+ _context.next = 4;
56
+ return onCreate(result.url);
57
+ case 4:
58
+ case "end":
59
+ return _context.stop();
60
+ }
61
+ }, _callee);
62
+ }));
63
+ return function (_x) {
64
+ return _ref2.apply(this, arguments);
65
+ };
66
+ }(), [onCreate, setFormErrorMessage]);
47
67
  var handleFailure = (0, _react.useCallback)(function (errorMessage) {
48
68
  // Set the form error message
49
69
  setFormErrorMessage(errorMessage);
@@ -66,7 +86,7 @@ var LinkCreateWithModal = function LinkCreateWithModal(props) {
66
86
  createAnalyticsEvent((0, _analytics2.default)('screen.linkCreateScreen.viewed', {})).fire(_constants.ANALYTICS_CHANNEL);
67
87
  }, [createAnalyticsEvent]);
68
88
  var handleCloseComplete = (0, _react.useCallback)(function () {
69
- createAnalyticsEvent((0, _analytics2.default)('screen.linkCreateScreen.closed', {})).fire(_constants.ANALYTICS_CHANNEL);
89
+ createAnalyticsEvent((0, _analytics2.default)('ui.modalDialog.closed.linkCreate', {})).fire(_constants.ANALYTICS_CHANNEL);
70
90
  }, [createAnalyticsEvent]);
71
91
  return (0, _react2.jsx)(_modalDialog.ModalTransition, null, !!active && (0, _react2.jsx)(_modalDialog.default, {
72
92
  onClose: onCancel,
@@ -76,8 +96,8 @@ var LinkCreateWithModal = function LinkCreateWithModal(props) {
76
96
  onCloseComplete: handleCloseComplete
77
97
  }, (0, _react2.jsx)(_modalDialog.ModalHeader, null, (0, _react2.jsx)(_modalDialog.ModalTitle, null, intl.formatMessage(_messages.messages.heading))), (0, _react2.jsx)(_modalDialog.ModalBody, null, (0, _react2.jsx)(_errorBoundary.ErrorBoundary, null, (0, _react2.jsx)(_formContext.FormContextProvider, null, (0, _react2.jsx)(LinkCreate, props))))));
78
98
  };
79
- var LinkCreateWithAnalyticsContext = (0, _analytics.withLinkCreateAnalyticsContext)( /*#__PURE__*/(0, _react.memo)(function (_ref2) {
80
- var props = (0, _extends2.default)({}, ((0, _objectDestructuringEmpty2.default)(_ref2), _ref2));
99
+ var LinkCreateWithAnalyticsContext = (0, _analytics.withLinkCreateAnalyticsContext)( /*#__PURE__*/(0, _react.memo)(function (_ref3) {
100
+ var props = (0, _extends2.default)({}, ((0, _objectDestructuringEmpty2.default)(_ref3), _ref3));
81
101
  return (0, _react2.jsx)(LinkCreateWithModal, props);
82
102
  }));
83
103
  var PACKAGE_DATA = {
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/link-create",
3
- "version": "0.5.4",
3
+ "version": "0.5.6",
4
4
  "sideEffects": false
5
5
  }
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * Generates Typescript types for analytics events from analytics.spec.yaml
5
5
  *
6
- * @codegen <<SignedSource::1c6720e63161d16bb99fc183b17d1944>>
6
+ * @codegen <<SignedSource::6c4bc6f47b1cf9cb3a9a70cac9a93775>>
7
7
  * @codegenCommand yarn workspace @atlaskit/link-create run codegen-analytics
8
8
  */
9
9
 
@@ -13,7 +13,7 @@ const LinkCreateCallbackProvider = ({
13
13
  createAnalyticsEvent
14
14
  } = useAnalyticsEvents();
15
15
  const value = useMemo(() => ({
16
- onCreate: result => {
16
+ onCreate: async result => {
17
17
  const {
18
18
  objectId,
19
19
  objectType
@@ -22,7 +22,9 @@ const LinkCreateCallbackProvider = ({
22
22
  objectId,
23
23
  objectType
24
24
  })).fire(ANALYTICS_CHANNEL);
25
- onCreate && onCreate(result);
25
+ if (onCreate) {
26
+ await onCreate(result);
27
+ }
26
28
  },
27
29
  onFailure,
28
30
  onCancel
@@ -51,7 +51,7 @@ export const CreateForm = ({
51
51
  if (Object.keys(errors).length !== 0) {
52
52
  return errors;
53
53
  }
54
- onSubmit(data);
54
+ return onSubmit(data);
55
55
  }, [createAnalyticsEvent, getValidators, onSubmit]);
56
56
  const handleCancel = useCallback(() => {
57
57
  createAnalyticsEvent(createEventPayload('ui.button.clicked.cancel', {})).fire(ANALYTICS_CHANNEL);
@@ -81,8 +81,8 @@ export const CreateForm = ({
81
81
  onClick: handleCancel,
82
82
  testId: 'close-button'
83
83
  }, intl.formatMessage(messages.close)), jsx(LoadingButton, {
84
- appearance: "primary",
85
84
  type: "submit",
85
+ appearance: "primary",
86
86
  isLoading: submitting,
87
87
  testId: 'create-button'
88
88
  }, intl.formatMessage(messages.create))))));
@@ -26,10 +26,12 @@ const LinkCreate = ({
26
26
  if (!chosenOne) {
27
27
  throw new Error('Make sure you specified a valid entityKey');
28
28
  }
29
- const handleCreate = useCallback(result => {
29
+ const handleCreate = useCallback(async result => {
30
30
  // Reset the form error message
31
31
  setFormErrorMessage(undefined);
32
- onCreate && onCreate(result.url);
32
+ if (onCreate) {
33
+ await onCreate(result.url);
34
+ }
33
35
  }, [onCreate, setFormErrorMessage]);
34
36
  const handleFailure = useCallback(errorMessage => {
35
37
  // Set the form error message
@@ -56,7 +58,7 @@ const LinkCreateWithModal = props => {
56
58
  createAnalyticsEvent(createEventPayload('screen.linkCreateScreen.viewed', {})).fire(ANALYTICS_CHANNEL);
57
59
  }, [createAnalyticsEvent]);
58
60
  const handleCloseComplete = useCallback(() => {
59
- createAnalyticsEvent(createEventPayload('screen.linkCreateScreen.closed', {})).fire(ANALYTICS_CHANNEL);
61
+ createAnalyticsEvent(createEventPayload('ui.modalDialog.closed.linkCreate', {})).fire(ANALYTICS_CHANNEL);
60
62
  }, [createAnalyticsEvent]);
61
63
  return jsx(ModalTransition, null, !!active && jsx(Modal, {
62
64
  onClose: onCancel,
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/link-create",
3
- "version": "0.5.4",
3
+ "version": "0.5.6",
4
4
  "sideEffects": false
5
5
  }
@@ -4,7 +4,7 @@ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
4
4
  *
5
5
  * Generates Typescript types for analytics events from analytics.spec.yaml
6
6
  *
7
- * @codegen <<SignedSource::1c6720e63161d16bb99fc183b17d1944>>
7
+ * @codegen <<SignedSource::6c4bc6f47b1cf9cb3a9a70cac9a93775>>
8
8
  * @codegenCommand yarn workspace @atlaskit/link-create run codegen-analytics
9
9
  */
10
10
 
@@ -1,3 +1,5 @@
1
+ import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
2
+ import _regeneratorRuntime from "@babel/runtime/regenerator";
1
3
  import React, { useContext, useMemo } from 'react';
2
4
  import { useAnalyticsEvents } from '@atlaskit/analytics-next';
3
5
  import { ANALYTICS_CHANNEL } from '../../common/constants';
@@ -12,15 +14,34 @@ var LinkCreateCallbackProvider = function LinkCreateCallbackProvider(_ref) {
12
14
  createAnalyticsEvent = _useAnalyticsEvents.createAnalyticsEvent;
13
15
  var value = useMemo(function () {
14
16
  return {
15
- onCreate: function onCreate(result) {
16
- var objectId = result.objectId,
17
- objectType = result.objectType;
18
- createAnalyticsEvent(createEventPayload('track.object.created.linkCreate', {
19
- objectId: objectId,
20
- objectType: objectType
21
- })).fire(ANALYTICS_CHANNEL);
22
- _onCreate && _onCreate(result);
23
- },
17
+ onCreate: function () {
18
+ var _onCreate2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(result) {
19
+ var objectId, objectType;
20
+ return _regeneratorRuntime.wrap(function _callee$(_context) {
21
+ while (1) switch (_context.prev = _context.next) {
22
+ case 0:
23
+ objectId = result.objectId, objectType = result.objectType;
24
+ createAnalyticsEvent(createEventPayload('track.object.created.linkCreate', {
25
+ objectId: objectId,
26
+ objectType: objectType
27
+ })).fire(ANALYTICS_CHANNEL);
28
+ if (!_onCreate) {
29
+ _context.next = 5;
30
+ break;
31
+ }
32
+ _context.next = 5;
33
+ return _onCreate(result);
34
+ case 5:
35
+ case "end":
36
+ return _context.stop();
37
+ }
38
+ }, _callee);
39
+ }));
40
+ function onCreate(_x) {
41
+ return _onCreate2.apply(this, arguments);
42
+ }
43
+ return onCreate;
44
+ }(),
24
45
  onFailure: onFailure,
25
46
  onCancel: onCancel
26
47
  };
@@ -58,7 +58,7 @@ export var CreateForm = function CreateForm(_ref) {
58
58
  }
59
59
  return _context.abrupt("return", errors);
60
60
  case 5:
61
- onSubmit(data);
61
+ return _context.abrupt("return", onSubmit(data));
62
62
  case 6:
63
63
  case "end":
64
64
  return _context.stop();
@@ -97,8 +97,8 @@ export var CreateForm = function CreateForm(_ref) {
97
97
  onClick: handleCancel,
98
98
  testId: 'close-button'
99
99
  }, intl.formatMessage(messages.close)), jsx(LoadingButton, {
100
- appearance: "primary",
101
100
  type: "submit",
101
+ appearance: "primary",
102
102
  isLoading: submitting,
103
103
  testId: 'create-button'
104
104
  }, intl.formatMessage(messages.create)))));
@@ -1,5 +1,7 @@
1
1
  import _objectDestructuringEmpty from "@babel/runtime/helpers/objectDestructuringEmpty";
2
2
  import _extends from "@babel/runtime/helpers/extends";
3
+ import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
4
+ import _regeneratorRuntime from "@babel/runtime/regenerator";
3
5
  /** @jsx jsx */
4
6
  import { memo, useCallback } from 'react';
5
7
  import { jsx } from '@emotion/react';
@@ -28,11 +30,29 @@ var LinkCreate = function LinkCreate(_ref) {
28
30
  if (!chosenOne) {
29
31
  throw new Error('Make sure you specified a valid entityKey');
30
32
  }
31
- var handleCreate = useCallback(function (result) {
32
- // Reset the form error message
33
- setFormErrorMessage(undefined);
34
- onCreate && onCreate(result.url);
35
- }, [onCreate, setFormErrorMessage]);
33
+ var handleCreate = useCallback( /*#__PURE__*/function () {
34
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(result) {
35
+ return _regeneratorRuntime.wrap(function _callee$(_context) {
36
+ while (1) switch (_context.prev = _context.next) {
37
+ case 0:
38
+ // Reset the form error message
39
+ setFormErrorMessage(undefined);
40
+ if (!onCreate) {
41
+ _context.next = 4;
42
+ break;
43
+ }
44
+ _context.next = 4;
45
+ return onCreate(result.url);
46
+ case 4:
47
+ case "end":
48
+ return _context.stop();
49
+ }
50
+ }, _callee);
51
+ }));
52
+ return function (_x) {
53
+ return _ref2.apply(this, arguments);
54
+ };
55
+ }(), [onCreate, setFormErrorMessage]);
36
56
  var handleFailure = useCallback(function (errorMessage) {
37
57
  // Set the form error message
38
58
  setFormErrorMessage(errorMessage);
@@ -55,7 +75,7 @@ var LinkCreateWithModal = function LinkCreateWithModal(props) {
55
75
  createAnalyticsEvent(createEventPayload('screen.linkCreateScreen.viewed', {})).fire(ANALYTICS_CHANNEL);
56
76
  }, [createAnalyticsEvent]);
57
77
  var handleCloseComplete = useCallback(function () {
58
- createAnalyticsEvent(createEventPayload('screen.linkCreateScreen.closed', {})).fire(ANALYTICS_CHANNEL);
78
+ createAnalyticsEvent(createEventPayload('ui.modalDialog.closed.linkCreate', {})).fire(ANALYTICS_CHANNEL);
59
79
  }, [createAnalyticsEvent]);
60
80
  return jsx(ModalTransition, null, !!active && jsx(Modal, {
61
81
  onClose: onCancel,
@@ -65,8 +85,8 @@ var LinkCreateWithModal = function LinkCreateWithModal(props) {
65
85
  onCloseComplete: handleCloseComplete
66
86
  }, jsx(ModalHeader, null, jsx(ModalTitle, null, intl.formatMessage(messages.heading))), jsx(ModalBody, null, jsx(ErrorBoundary, null, jsx(FormContextProvider, null, jsx(LinkCreate, props))))));
67
87
  };
68
- var LinkCreateWithAnalyticsContext = withLinkCreateAnalyticsContext( /*#__PURE__*/memo(function (_ref2) {
69
- var props = _extends({}, (_objectDestructuringEmpty(_ref2), _ref2));
88
+ var LinkCreateWithAnalyticsContext = withLinkCreateAnalyticsContext( /*#__PURE__*/memo(function (_ref3) {
89
+ var props = _extends({}, (_objectDestructuringEmpty(_ref3), _ref3));
70
90
  return jsx(LinkCreateWithModal, props);
71
91
  }));
72
92
  export var PACKAGE_DATA = {
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/link-create",
3
- "version": "0.5.4",
3
+ "version": "0.5.6",
4
4
  "sideEffects": false
5
5
  }
@@ -65,7 +65,7 @@ export interface LinkCreateProps {
65
65
  /**
66
66
  * This callback for when the resource has been successfully created.
67
67
  */
68
- onCreate?: (url: string) => void;
68
+ onCreate?: (url: string) => Promise<void> | void;
69
69
  /**
70
70
  * This callback for any errors
71
71
  */
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * Generates Typescript types for analytics events from analytics.spec.yaml
5
5
  *
6
- * @codegen <<SignedSource::1c6720e63161d16bb99fc183b17d1944>>
6
+ * @codegen <<SignedSource::6c4bc6f47b1cf9cb3a9a70cac9a93775>>
7
7
  * @codegenCommand yarn workspace @atlaskit/link-create run codegen-analytics
8
8
  */
9
9
  export type PackageMetaDataType = {
@@ -20,7 +20,7 @@ export type LinkCreateAnalyticsContextType = {
20
20
  export type LinkCreateScreenViewedAttributesType = {};
21
21
  export type ButtonClickedCreateAttributesType = {};
22
22
  export type ButtonClickedCancelAttributesType = {};
23
- export type LinkCreateScreenClosedAttributesType = {};
23
+ export type ModalDialogClosedLinkCreateAttributesType = {};
24
24
  export type LinkCreateUnhandledErrorCaughtAttributesType = {
25
25
  browserInfo: string;
26
26
  error: string;
@@ -34,7 +34,7 @@ type AnalyticsEventAttributes = {
34
34
  'screen.linkCreateScreen.viewed': LinkCreateScreenViewedAttributesType;
35
35
  'ui.button.clicked.create': ButtonClickedCreateAttributesType;
36
36
  'ui.button.clicked.cancel': ButtonClickedCancelAttributesType;
37
- 'screen.linkCreateScreen.closed': LinkCreateScreenClosedAttributesType;
37
+ 'ui.modalDialog.closed.linkCreate': ModalDialogClosedLinkCreateAttributesType;
38
38
  'operational.linkCreate.unhandledErrorCaught': LinkCreateUnhandledErrorCaughtAttributesType;
39
39
  'track.object.created.linkCreate': ObjectCreatedLinkCreateAttributesType;
40
40
  };
@@ -7,7 +7,7 @@ interface LinkCreateCallbackProviderProps {
7
7
  url: string;
8
8
  objectId: string;
9
9
  objectType: string;
10
- }) => void;
10
+ }) => Promise<void> | void;
11
11
  /**
12
12
  * This callback for any errors
13
13
  */
@@ -65,7 +65,7 @@ export interface LinkCreateProps {
65
65
  /**
66
66
  * This callback for when the resource has been successfully created.
67
67
  */
68
- onCreate?: (url: string) => void;
68
+ onCreate?: (url: string) => Promise<void> | void;
69
69
  /**
70
70
  * This callback for any errors
71
71
  */
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * Generates Typescript types for analytics events from analytics.spec.yaml
5
5
  *
6
- * @codegen <<SignedSource::1c6720e63161d16bb99fc183b17d1944>>
6
+ * @codegen <<SignedSource::6c4bc6f47b1cf9cb3a9a70cac9a93775>>
7
7
  * @codegenCommand yarn workspace @atlaskit/link-create run codegen-analytics
8
8
  */
9
9
  export type PackageMetaDataType = {
@@ -20,7 +20,7 @@ export type LinkCreateAnalyticsContextType = {
20
20
  export type LinkCreateScreenViewedAttributesType = {};
21
21
  export type ButtonClickedCreateAttributesType = {};
22
22
  export type ButtonClickedCancelAttributesType = {};
23
- export type LinkCreateScreenClosedAttributesType = {};
23
+ export type ModalDialogClosedLinkCreateAttributesType = {};
24
24
  export type LinkCreateUnhandledErrorCaughtAttributesType = {
25
25
  browserInfo: string;
26
26
  error: string;
@@ -34,7 +34,7 @@ type AnalyticsEventAttributes = {
34
34
  'screen.linkCreateScreen.viewed': LinkCreateScreenViewedAttributesType;
35
35
  'ui.button.clicked.create': ButtonClickedCreateAttributesType;
36
36
  'ui.button.clicked.cancel': ButtonClickedCancelAttributesType;
37
- 'screen.linkCreateScreen.closed': LinkCreateScreenClosedAttributesType;
37
+ 'ui.modalDialog.closed.linkCreate': ModalDialogClosedLinkCreateAttributesType;
38
38
  'operational.linkCreate.unhandledErrorCaught': LinkCreateUnhandledErrorCaughtAttributesType;
39
39
  'track.object.created.linkCreate': ObjectCreatedLinkCreateAttributesType;
40
40
  };
@@ -7,7 +7,7 @@ interface LinkCreateCallbackProviderProps {
7
7
  url: string;
8
8
  objectId: string;
9
9
  objectType: string;
10
- }) => void;
10
+ }) => Promise<void> | void;
11
11
  /**
12
12
  * This callback for any errors
13
13
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/link-create",
3
- "version": "0.5.4",
3
+ "version": "0.5.6",
4
4
  "description": "The driver component of meta creation flow",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -39,7 +39,7 @@
39
39
  "@atlaskit/empty-state": "^7.5.0",
40
40
  "@atlaskit/form": "^8.11.0",
41
41
  "@atlaskit/icon": "^21.12.0",
42
- "@atlaskit/modal-dialog": "^12.5.0",
42
+ "@atlaskit/modal-dialog": "^12.6.0",
43
43
  "@atlaskit/select": "^16.5.0",
44
44
  "@atlaskit/spinner": "^15.4.0",
45
45
  "@atlaskit/textfield": "^5.5.0",
@@ -60,7 +60,7 @@
60
60
  "@atlassian/atlassian-frontend-prettier-config-1.0.0": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.0",
61
61
  "@atlassian/link-create-confluence": "^6.1.0",
62
62
  "@atlassian/link-create-presets": "^4.0.0",
63
- "@atlassian/link-picker-atlassian-plugin": "^32.1.0",
63
+ "@atlassian/link-picker-atlassian-plugin": "^33.0.0",
64
64
  "@testing-library/react": "^12.1.5",
65
65
  "@testing-library/user-event": "^14.4.3",
66
66
  "fetch-mock": "^8.0.0",
package/report.api.md CHANGED
@@ -117,7 +117,7 @@ interface LinkCreateCallbackProviderProps {
117
117
  url: string;
118
118
  objectId: string;
119
119
  objectType: string;
120
- }) => void;
120
+ }) => Promise<void> | void;
121
121
  onFailure?: (errorMessage: string) => void;
122
122
  }
123
123
 
@@ -136,7 +136,7 @@ export interface LinkCreateProps {
136
136
  entityKey: string;
137
137
  groupKey?: string;
138
138
  onCancel?: () => void;
139
- onCreate?: (url: string) => void;
139
+ onCreate?: (url: string) => Promise<void> | void;
140
140
  onFailure?: (error: unknown) => void;
141
141
  // (undocumented)
142
142
  plugins: LinkCreatePlugin[];
@@ -86,7 +86,7 @@ interface LinkCreateCallbackProviderProps {
86
86
  url: string;
87
87
  objectId: string;
88
88
  objectType: string;
89
- }) => void;
89
+ }) => Promise<void> | void;
90
90
  onFailure?: (errorMessage: string) => void;
91
91
  }
92
92
 
@@ -105,7 +105,7 @@ export interface LinkCreateProps {
105
105
  entityKey: string;
106
106
  groupKey?: string;
107
107
  onCancel?: () => void;
108
- onCreate?: (url: string) => void;
108
+ onCreate?: (url: string) => Promise<void> | void;
109
109
  onFailure?: (error: unknown) => void;
110
110
  // (undocumented)
111
111
  plugins: LinkCreatePlugin[];