@atlaskit/link-create 1.7.1 → 1.8.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 +12 -0
- package/dist/cjs/ui/link-create/main.js +27 -9
- package/dist/cjs/ui/main.js +1 -1
- package/dist/es2019/ui/link-create/main.js +12 -9
- package/dist/es2019/ui/main.js +1 -1
- package/dist/esm/ui/link-create/main.js +27 -9
- package/dist/esm/ui/main.js +1 -1
- package/dist/types/common/types.d.ts +6 -0
- package/dist/types/ui/link-create/main.d.ts +2 -2
- package/dist/types-ts4.5/common/types.d.ts +6 -0
- package/dist/types-ts4.5/ui/link-create/main.d.ts +2 -2
- package/package.json +5 -5
- package/report.api.md +1 -0
- package/tmp/api-report-tmp.d.ts +1 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @atlaskit/link-create
|
|
2
2
|
|
|
3
|
+
## 1.8.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#42777](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/42777) [`fe571895d1f`](https://bitbucket.org/atlassian/atlassian-frontend/commits/fe571895d1f) - EDM-8401: Introduce the onComplete props to LinkCreateProps which is a callback function to be called when the link create experience is completed. This prop allows a post-create edit flow to be added into the link create experience before completion.
|
|
8
|
+
|
|
9
|
+
## 1.7.2
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- Updated dependencies
|
|
14
|
+
|
|
3
15
|
## 1.7.1
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
|
@@ -128,16 +128,16 @@ var LinkCreateWithModal = function LinkCreateWithModal(_ref4) {
|
|
|
128
128
|
width: "".concat(_constants.CREATE_FORM_MAX_WIDTH_IN_PX, "px")
|
|
129
129
|
}, (0, _react2.jsx)(_modalDialog.ModalHeader, null, (0, _react2.jsx)(_modalDialog.ModalTitle, null, modalTitle || intl.formatMessage(_messages.messages.heading))), (0, _react2.jsx)(_modalDialog.ModalBody, null, (0, _react2.jsx)(LinkCreate, (0, _extends2.default)({}, createProps, {
|
|
130
130
|
onCancel: handleCancel
|
|
131
|
-
}))))), (0, _platformFeatureFlags.getBooleanFF)('platform.linking-platform.link-create.enable-edit') && (0, _react2.jsx)(_editModal.EditModal, {
|
|
131
|
+
}))))), (0, _platformFeatureFlags.getBooleanFF)('platform.linking-platform.link-create.enable-edit') && createProps.onComplete && (0, _react2.jsx)(_editModal.EditModal, {
|
|
132
132
|
onCloseComplete: onCloseComplete,
|
|
133
|
-
onClose:
|
|
133
|
+
onClose: createProps.onComplete
|
|
134
134
|
}), (0, _platformFeatureFlags.getBooleanFF)('platform.linking-platform.link-create.confirm-dismiss-dialog') && (0, _react2.jsx)(_confirmDismissDialog.ConfirmDismissDialog, {
|
|
135
135
|
active: dismissDialog,
|
|
136
136
|
onCancelDismiss: handleCancelDismiss,
|
|
137
137
|
onConfirmDismiss: handleConfirmDismiss
|
|
138
138
|
}));
|
|
139
139
|
};
|
|
140
|
-
var
|
|
140
|
+
var LinkCreateModal = function LinkCreateModal(props) {
|
|
141
141
|
if ((0, _platformFeatureFlags.getBooleanFF)('platform.linking-platform.link-create.enable-edit')) {
|
|
142
142
|
return (0, _react2.jsx)(_pluginContext.LinkCreatePluginsProvider, {
|
|
143
143
|
plugins: props.plugins,
|
|
@@ -152,7 +152,7 @@ var LinkCreateModalInternal = function LinkCreateModalInternal(props) {
|
|
|
152
152
|
shouldActivateEditView = _ref5.shouldActivateEditView,
|
|
153
153
|
enableEditView = _ref5.enableEditView;
|
|
154
154
|
return (0, _react2.jsx)(_formContext.FormContextProvider, {
|
|
155
|
-
enableEditView: pluginsProvider !== null && pluginsProvider !== void 0 && (_pluginsProvider$acti = pluginsProvider.activePlugin) !== null && _pluginsProvider$acti !== void 0 && _pluginsProvider$acti.editView ? enableEditView : undefined
|
|
155
|
+
enableEditView: pluginsProvider !== null && pluginsProvider !== void 0 && (_pluginsProvider$acti = pluginsProvider.activePlugin) !== null && _pluginsProvider$acti !== void 0 && _pluginsProvider$acti.editView && props !== null && props !== void 0 && props.onComplete ? enableEditView : undefined
|
|
156
156
|
}, (0, _react2.jsx)(LinkCreateWithModal, (0, _extends2.default)({}, props, {
|
|
157
157
|
active: props.active && !editViewPayload,
|
|
158
158
|
onCreate: /*#__PURE__*/function () {
|
|
@@ -188,9 +188,27 @@ var LinkCreateModalInternal = function LinkCreateModalInternal(props) {
|
|
|
188
188
|
});
|
|
189
189
|
});
|
|
190
190
|
}
|
|
191
|
-
return (0, _react2.jsx)(_formContext.FormContextProvider, null, (0, _react2.jsx)(LinkCreateWithModal, props
|
|
191
|
+
return (0, _react2.jsx)(_formContext.FormContextProvider, null, (0, _react2.jsx)(LinkCreateWithModal, (0, _extends2.default)({}, props, {
|
|
192
|
+
onCreate: /*#__PURE__*/function () {
|
|
193
|
+
var _ref7 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3(payload) {
|
|
194
|
+
var _props$onCreate2, _props$onComplete;
|
|
195
|
+
return _regenerator.default.wrap(function _callee3$(_context3) {
|
|
196
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
197
|
+
case 0:
|
|
198
|
+
_context3.next = 2;
|
|
199
|
+
return (_props$onCreate2 = props.onCreate) === null || _props$onCreate2 === void 0 ? void 0 : _props$onCreate2.call(props, payload);
|
|
200
|
+
case 2:
|
|
201
|
+
(_props$onComplete = props.onComplete) === null || _props$onComplete === void 0 || _props$onComplete.call(props);
|
|
202
|
+
case 3:
|
|
203
|
+
case "end":
|
|
204
|
+
return _context3.stop();
|
|
205
|
+
}
|
|
206
|
+
}, _callee3);
|
|
207
|
+
}));
|
|
208
|
+
return function (_x3) {
|
|
209
|
+
return _ref7.apply(this, arguments);
|
|
210
|
+
};
|
|
211
|
+
}()
|
|
212
|
+
})));
|
|
192
213
|
};
|
|
193
|
-
var
|
|
194
|
-
return (0, _react2.jsx)(LinkCreateModalInternal, props);
|
|
195
|
-
};
|
|
196
|
-
var _default = exports.default = LinkCreateModalPublic;
|
|
214
|
+
var _default = exports.default = LinkCreateModal;
|
package/dist/cjs/ui/main.js
CHANGED
|
@@ -35,7 +35,7 @@ var LinkCreateWithAnalyticsContext = (0, _analytics.withLinkCreateAnalyticsConte
|
|
|
35
35
|
}));
|
|
36
36
|
var PACKAGE_DATA = exports.PACKAGE_DATA = {
|
|
37
37
|
packageName: "@atlaskit/link-create" || '',
|
|
38
|
-
packageVersion: "1.
|
|
38
|
+
packageVersion: "1.8.0" || '',
|
|
39
39
|
componentName: _constants.COMPONENT_NAME,
|
|
40
40
|
source: _constants.COMPONENT_NAME
|
|
41
41
|
};
|
|
@@ -95,16 +95,16 @@ const LinkCreateWithModal = ({
|
|
|
95
95
|
width: `${CREATE_FORM_MAX_WIDTH_IN_PX}px`
|
|
96
96
|
}, jsx(ModalHeader, null, jsx(ModalTitle, null, modalTitle || intl.formatMessage(messages.heading))), jsx(ModalBody, null, jsx(LinkCreate, _extends({}, createProps, {
|
|
97
97
|
onCancel: handleCancel
|
|
98
|
-
}))))), getBooleanFF('platform.linking-platform.link-create.enable-edit') && jsx(EditModal, {
|
|
98
|
+
}))))), getBooleanFF('platform.linking-platform.link-create.enable-edit') && createProps.onComplete && jsx(EditModal, {
|
|
99
99
|
onCloseComplete: onCloseComplete,
|
|
100
|
-
onClose:
|
|
100
|
+
onClose: createProps.onComplete
|
|
101
101
|
}), getBooleanFF('platform.linking-platform.link-create.confirm-dismiss-dialog') && jsx(ConfirmDismissDialog, {
|
|
102
102
|
active: dismissDialog,
|
|
103
103
|
onCancelDismiss: handleCancelDismiss,
|
|
104
104
|
onConfirmDismiss: handleConfirmDismiss
|
|
105
105
|
}));
|
|
106
106
|
};
|
|
107
|
-
const
|
|
107
|
+
const LinkCreateModal = props => {
|
|
108
108
|
if (getBooleanFF('platform.linking-platform.link-create.enable-edit')) {
|
|
109
109
|
return jsx(LinkCreatePluginsProvider, {
|
|
110
110
|
plugins: props.plugins,
|
|
@@ -119,7 +119,7 @@ const LinkCreateModalInternal = props => {
|
|
|
119
119
|
}) => {
|
|
120
120
|
var _pluginsProvider$acti;
|
|
121
121
|
return jsx(FormContextProvider, {
|
|
122
|
-
enableEditView: pluginsProvider !== null && pluginsProvider !== void 0 && (_pluginsProvider$acti = pluginsProvider.activePlugin) !== null && _pluginsProvider$acti !== void 0 && _pluginsProvider$acti.editView ? enableEditView : undefined
|
|
122
|
+
enableEditView: pluginsProvider !== null && pluginsProvider !== void 0 && (_pluginsProvider$acti = pluginsProvider.activePlugin) !== null && _pluginsProvider$acti !== void 0 && _pluginsProvider$acti.editView && props !== null && props !== void 0 && props.onComplete ? enableEditView : undefined
|
|
123
123
|
}, jsx(LinkCreateWithModal, _extends({}, props, {
|
|
124
124
|
active: props.active && !editViewPayload,
|
|
125
125
|
onCreate: async payload => {
|
|
@@ -140,9 +140,12 @@ const LinkCreateModalInternal = props => {
|
|
|
140
140
|
})));
|
|
141
141
|
}));
|
|
142
142
|
}
|
|
143
|
-
return jsx(FormContextProvider, null, jsx(LinkCreateWithModal, props
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
143
|
+
return jsx(FormContextProvider, null, jsx(LinkCreateWithModal, _extends({}, props, {
|
|
144
|
+
onCreate: async payload => {
|
|
145
|
+
var _props$onCreate2, _props$onComplete;
|
|
146
|
+
await ((_props$onCreate2 = props.onCreate) === null || _props$onCreate2 === void 0 ? void 0 : _props$onCreate2.call(props, payload));
|
|
147
|
+
(_props$onComplete = props.onComplete) === null || _props$onComplete === void 0 ? void 0 : _props$onComplete.call(props);
|
|
148
|
+
}
|
|
149
|
+
})));
|
|
147
150
|
};
|
|
148
|
-
export default
|
|
151
|
+
export default LinkCreateModal;
|
package/dist/es2019/ui/main.js
CHANGED
|
@@ -26,7 +26,7 @@ const LinkCreateWithAnalyticsContext = withLinkCreateAnalyticsContext( /*#__PURE
|
|
|
26
26
|
}));
|
|
27
27
|
export const PACKAGE_DATA = {
|
|
28
28
|
packageName: "@atlaskit/link-create" || '',
|
|
29
|
-
packageVersion: "1.
|
|
29
|
+
packageVersion: "1.8.0" || '',
|
|
30
30
|
componentName: COMPONENT_NAME,
|
|
31
31
|
source: COMPONENT_NAME
|
|
32
32
|
};
|
|
@@ -118,16 +118,16 @@ var LinkCreateWithModal = function LinkCreateWithModal(_ref4) {
|
|
|
118
118
|
width: "".concat(CREATE_FORM_MAX_WIDTH_IN_PX, "px")
|
|
119
119
|
}, jsx(ModalHeader, null, jsx(ModalTitle, null, modalTitle || intl.formatMessage(messages.heading))), jsx(ModalBody, null, jsx(LinkCreate, _extends({}, createProps, {
|
|
120
120
|
onCancel: handleCancel
|
|
121
|
-
}))))), getBooleanFF('platform.linking-platform.link-create.enable-edit') && jsx(EditModal, {
|
|
121
|
+
}))))), getBooleanFF('platform.linking-platform.link-create.enable-edit') && createProps.onComplete && jsx(EditModal, {
|
|
122
122
|
onCloseComplete: onCloseComplete,
|
|
123
|
-
onClose:
|
|
123
|
+
onClose: createProps.onComplete
|
|
124
124
|
}), getBooleanFF('platform.linking-platform.link-create.confirm-dismiss-dialog') && jsx(ConfirmDismissDialog, {
|
|
125
125
|
active: dismissDialog,
|
|
126
126
|
onCancelDismiss: handleCancelDismiss,
|
|
127
127
|
onConfirmDismiss: handleConfirmDismiss
|
|
128
128
|
}));
|
|
129
129
|
};
|
|
130
|
-
var
|
|
130
|
+
var LinkCreateModal = function LinkCreateModal(props) {
|
|
131
131
|
if (getBooleanFF('platform.linking-platform.link-create.enable-edit')) {
|
|
132
132
|
return jsx(LinkCreatePluginsProvider, {
|
|
133
133
|
plugins: props.plugins,
|
|
@@ -142,7 +142,7 @@ var LinkCreateModalInternal = function LinkCreateModalInternal(props) {
|
|
|
142
142
|
shouldActivateEditView = _ref5.shouldActivateEditView,
|
|
143
143
|
enableEditView = _ref5.enableEditView;
|
|
144
144
|
return jsx(FormContextProvider, {
|
|
145
|
-
enableEditView: pluginsProvider !== null && pluginsProvider !== void 0 && (_pluginsProvider$acti = pluginsProvider.activePlugin) !== null && _pluginsProvider$acti !== void 0 && _pluginsProvider$acti.editView ? enableEditView : undefined
|
|
145
|
+
enableEditView: pluginsProvider !== null && pluginsProvider !== void 0 && (_pluginsProvider$acti = pluginsProvider.activePlugin) !== null && _pluginsProvider$acti !== void 0 && _pluginsProvider$acti.editView && props !== null && props !== void 0 && props.onComplete ? enableEditView : undefined
|
|
146
146
|
}, jsx(LinkCreateWithModal, _extends({}, props, {
|
|
147
147
|
active: props.active && !editViewPayload,
|
|
148
148
|
onCreate: /*#__PURE__*/function () {
|
|
@@ -178,9 +178,27 @@ var LinkCreateModalInternal = function LinkCreateModalInternal(props) {
|
|
|
178
178
|
});
|
|
179
179
|
});
|
|
180
180
|
}
|
|
181
|
-
return jsx(FormContextProvider, null, jsx(LinkCreateWithModal, props
|
|
181
|
+
return jsx(FormContextProvider, null, jsx(LinkCreateWithModal, _extends({}, props, {
|
|
182
|
+
onCreate: /*#__PURE__*/function () {
|
|
183
|
+
var _ref7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(payload) {
|
|
184
|
+
var _props$onCreate2, _props$onComplete;
|
|
185
|
+
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
|
186
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
187
|
+
case 0:
|
|
188
|
+
_context3.next = 2;
|
|
189
|
+
return (_props$onCreate2 = props.onCreate) === null || _props$onCreate2 === void 0 ? void 0 : _props$onCreate2.call(props, payload);
|
|
190
|
+
case 2:
|
|
191
|
+
(_props$onComplete = props.onComplete) === null || _props$onComplete === void 0 || _props$onComplete.call(props);
|
|
192
|
+
case 3:
|
|
193
|
+
case "end":
|
|
194
|
+
return _context3.stop();
|
|
195
|
+
}
|
|
196
|
+
}, _callee3);
|
|
197
|
+
}));
|
|
198
|
+
return function (_x3) {
|
|
199
|
+
return _ref7.apply(this, arguments);
|
|
200
|
+
};
|
|
201
|
+
}()
|
|
202
|
+
})));
|
|
182
203
|
};
|
|
183
|
-
|
|
184
|
-
return jsx(LinkCreateModalInternal, props);
|
|
185
|
-
};
|
|
186
|
-
export default LinkCreateModalPublic;
|
|
204
|
+
export default LinkCreateModal;
|
package/dist/esm/ui/main.js
CHANGED
|
@@ -27,7 +27,7 @@ var LinkCreateWithAnalyticsContext = withLinkCreateAnalyticsContext( /*#__PURE__
|
|
|
27
27
|
}));
|
|
28
28
|
export var PACKAGE_DATA = {
|
|
29
29
|
packageName: "@atlaskit/link-create" || '',
|
|
30
|
-
packageVersion: "1.
|
|
30
|
+
packageVersion: "1.8.0" || '',
|
|
31
31
|
componentName: COMPONENT_NAME,
|
|
32
32
|
source: COMPONENT_NAME
|
|
33
33
|
};
|
|
@@ -101,6 +101,12 @@ export interface LinkCreateProps {
|
|
|
101
101
|
* This callback for when the resource has been successfully created.
|
|
102
102
|
*/
|
|
103
103
|
onCreate?: (payload: CreatePayload) => Promise<void> | void;
|
|
104
|
+
/**
|
|
105
|
+
* This callback for when the LinkCreate experience has successfully been completed.
|
|
106
|
+
* Note: this callback is one of the requirements to enable the LinkCreate
|
|
107
|
+
* post-create edit functionality
|
|
108
|
+
*/
|
|
109
|
+
onComplete?: () => void;
|
|
104
110
|
/**
|
|
105
111
|
* This callback for any errors
|
|
106
112
|
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx } from '@emotion/react';
|
|
2
2
|
import { LinkCreateWithModalProps } from '../../common/types';
|
|
3
3
|
export declare const TEST_ID = "link-create";
|
|
4
|
-
declare const
|
|
5
|
-
export default
|
|
4
|
+
declare const LinkCreateModal: (props: LinkCreateWithModalProps) => jsx.JSX.Element;
|
|
5
|
+
export default LinkCreateModal;
|
|
@@ -101,6 +101,12 @@ export interface LinkCreateProps {
|
|
|
101
101
|
* This callback for when the resource has been successfully created.
|
|
102
102
|
*/
|
|
103
103
|
onCreate?: (payload: CreatePayload) => Promise<void> | void;
|
|
104
|
+
/**
|
|
105
|
+
* This callback for when the LinkCreate experience has successfully been completed.
|
|
106
|
+
* Note: this callback is one of the requirements to enable the LinkCreate
|
|
107
|
+
* post-create edit functionality
|
|
108
|
+
*/
|
|
109
|
+
onComplete?: () => void;
|
|
104
110
|
/**
|
|
105
111
|
* This callback for any errors
|
|
106
112
|
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx } from '@emotion/react';
|
|
2
2
|
import { LinkCreateWithModalProps } from '../../common/types';
|
|
3
3
|
export declare const TEST_ID = "link-create";
|
|
4
|
-
declare const
|
|
5
|
-
export default
|
|
4
|
+
declare const LinkCreateModal: (props: LinkCreateWithModalProps) => jsx.JSX.Element;
|
|
5
|
+
export default LinkCreateModal;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/link-create",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.8.0",
|
|
4
4
|
"description": "The driver component of meta creation flow",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -35,15 +35,15 @@
|
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
37
|
"@atlaskit/analytics-next": "^9.1.0",
|
|
38
|
-
"@atlaskit/button": "^16.
|
|
38
|
+
"@atlaskit/button": "^16.14.0",
|
|
39
39
|
"@atlaskit/empty-state": "^7.6.0",
|
|
40
|
-
"@atlaskit/form": "^
|
|
40
|
+
"@atlaskit/form": "^9.0.0",
|
|
41
41
|
"@atlaskit/icon": "^21.12.0",
|
|
42
42
|
"@atlaskit/intl-messages-provider": "^1.0.0",
|
|
43
|
-
"@atlaskit/linking-common": "^4.
|
|
43
|
+
"@atlaskit/linking-common": "^4.17.0",
|
|
44
44
|
"@atlaskit/modal-dialog": "^12.8.0",
|
|
45
45
|
"@atlaskit/platform-feature-flags": "^0.2.1",
|
|
46
|
-
"@atlaskit/primitives": "^1.
|
|
46
|
+
"@atlaskit/primitives": "^1.10.0",
|
|
47
47
|
"@atlaskit/select": "^16.7.0",
|
|
48
48
|
"@atlaskit/spinner": "^15.6.0",
|
|
49
49
|
"@atlaskit/textfield": "^5.6.0",
|
package/report.api.md
CHANGED
|
@@ -157,6 +157,7 @@ export interface LinkCreateProps {
|
|
|
157
157
|
entityKey: string;
|
|
158
158
|
groupKey?: string;
|
|
159
159
|
onCancel?: () => void;
|
|
160
|
+
onComplete?: () => void;
|
|
160
161
|
onCreate?: (payload: CreatePayload) => Promise<void> | void;
|
|
161
162
|
onFailure?: (error: unknown) => void;
|
|
162
163
|
// (undocumented)
|
package/tmp/api-report-tmp.d.ts
CHANGED
|
@@ -120,6 +120,7 @@ export interface LinkCreateProps {
|
|
|
120
120
|
entityKey: string;
|
|
121
121
|
groupKey?: string;
|
|
122
122
|
onCancel?: () => void;
|
|
123
|
+
onComplete?: () => void;
|
|
123
124
|
onCreate?: (payload: CreatePayload) => Promise<void> | void;
|
|
124
125
|
onFailure?: (error: unknown) => void;
|
|
125
126
|
// (undocumented)
|