@atlaskit/link-create 2.0.0 → 2.1.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 +343 -337
- package/dist/cjs/common/constants.js +8 -2
- package/dist/cjs/{ui/link-create → common/ui}/confirm-dismiss-dialog/main.js +4 -6
- package/dist/cjs/{ui/link-create → common/ui}/edit-modal/index.js +4 -8
- package/dist/cjs/{ui/link-create → common/ui}/error-boundary/index.js +1 -1
- package/dist/cjs/{controllers → common/ui}/experience-tracker/index.js +3 -3
- package/dist/cjs/common/ui/link-create-content/index.js +21 -0
- package/dist/cjs/{ui/link-create → common/ui}/modal-hero/index.js +1 -3
- package/dist/cjs/controllers/callback-context/main.js +1 -1
- package/dist/cjs/ui/index.js +11 -4
- package/dist/cjs/ui/{main.js → inline-create/index.js} +11 -17
- package/dist/cjs/ui/inline-create/main.js +125 -0
- package/dist/cjs/ui/modal-create/index.js +38 -0
- package/dist/cjs/ui/{link-create → modal-create}/main.js +36 -39
- package/dist/es2019/common/constants.js +7 -1
- package/dist/es2019/{ui/link-create → common/ui}/confirm-dismiss-dialog/main.js +4 -7
- package/dist/es2019/{ui/link-create → common/ui}/edit-modal/index.js +4 -10
- package/dist/es2019/{ui/link-create → common/ui}/error-boundary/index.js +1 -1
- package/dist/es2019/{controllers → common/ui}/experience-tracker/index.js +3 -3
- package/dist/es2019/common/ui/link-create-content/index.js +11 -0
- package/dist/es2019/{ui/link-create → common/ui}/modal-hero/index.js +1 -3
- package/dist/es2019/controllers/callback-context/main.js +1 -1
- package/dist/es2019/index.js +4 -1
- package/dist/es2019/ui/index.js +2 -1
- package/dist/es2019/ui/inline-create/index.js +30 -0
- package/dist/es2019/ui/inline-create/main.js +100 -0
- package/dist/es2019/ui/{main.js → modal-create/index.js} +8 -14
- package/dist/es2019/ui/{link-create → modal-create}/main.js +19 -19
- package/dist/esm/common/constants.js +7 -1
- package/dist/esm/{ui/link-create → common/ui}/confirm-dismiss-dialog/main.js +4 -6
- package/dist/esm/{ui/link-create → common/ui}/edit-modal/index.js +4 -8
- package/dist/esm/{ui/link-create → common/ui}/error-boundary/index.js +1 -1
- package/dist/esm/{controllers → common/ui}/experience-tracker/index.js +3 -3
- package/dist/esm/common/ui/link-create-content/index.js +12 -0
- package/dist/esm/{ui/link-create → common/ui}/modal-hero/index.js +1 -3
- package/dist/esm/controllers/callback-context/main.js +1 -1
- package/dist/esm/index.js +4 -1
- package/dist/esm/ui/index.js +2 -1
- package/dist/esm/ui/inline-create/index.js +30 -0
- package/dist/esm/ui/inline-create/main.js +119 -0
- package/dist/esm/ui/{main.js → modal-create/index.js} +8 -14
- package/dist/esm/ui/{link-create → modal-create}/main.js +38 -41
- package/dist/types/common/constants.d.ts +2 -0
- package/dist/types/common/ui/Button/index.d.ts +1 -1
- package/dist/types/common/ui/confirm-dismiss-dialog/main.d.ts +7 -0
- package/dist/types/common/ui/edit-modal/index.d.ts +11 -0
- package/dist/types/common/ui/link-create-content/index.d.ts +8 -0
- package/dist/types/ui/index.d.ts +2 -1
- package/dist/types/ui/inline-create/index.d.ts +5 -0
- package/dist/types/ui/inline-create/main.d.ts +5 -0
- package/dist/types/ui/modal-create/index.d.ts +5 -0
- package/dist/{types-ts4.5/ui/link-create → types/ui/modal-create}/main.d.ts +1 -1
- package/dist/types-ts4.5/common/constants.d.ts +2 -0
- package/dist/types-ts4.5/common/ui/Button/index.d.ts +1 -1
- package/dist/types-ts4.5/common/ui/confirm-dismiss-dialog/main.d.ts +7 -0
- package/dist/types-ts4.5/common/ui/edit-modal/index.d.ts +11 -0
- package/dist/types-ts4.5/common/ui/link-create-content/index.d.ts +8 -0
- package/dist/types-ts4.5/ui/index.d.ts +2 -1
- package/dist/types-ts4.5/ui/{main.d.ts → inline-create/index.d.ts} +1 -3
- package/dist/types-ts4.5/ui/inline-create/main.d.ts +5 -0
- package/dist/{types/ui/main.d.ts → types-ts4.5/ui/modal-create/index.d.ts} +1 -3
- package/dist/{types/ui/link-create → types-ts4.5/ui/modal-create}/main.d.ts +1 -1
- package/package.json +5 -7
- package/dist/cjs/ui/link-create/index.js +0 -13
- package/dist/es2019/ui/link-create/index.js +0 -1
- package/dist/esm/ui/link-create/index.js +0 -1
- package/dist/types/ui/link-create/confirm-dismiss-dialog/main.d.ts +0 -6
- package/dist/types/ui/link-create/edit-modal/index.d.ts +0 -8
- package/dist/types/ui/link-create/index.d.ts +0 -1
- package/dist/types-ts4.5/ui/link-create/confirm-dismiss-dialog/main.d.ts +0 -6
- package/dist/types-ts4.5/ui/link-create/edit-modal/index.d.ts +0 -8
- package/dist/types-ts4.5/ui/link-create/index.d.ts +0 -1
- /package/dist/cjs/{ui/link-create → common/ui}/confirm-dismiss-dialog/index.js +0 -0
- /package/dist/cjs/{ui/link-create → common/ui}/confirm-dismiss-dialog/messages.js +0 -0
- /package/dist/cjs/{ui/link-create → common/ui}/error-boundary/error-boundary-base/index.js +0 -0
- /package/dist/cjs/ui/{link-create → modal-create}/messages.js +0 -0
- /package/dist/es2019/{ui/link-create → common/ui}/confirm-dismiss-dialog/index.js +0 -0
- /package/dist/es2019/{ui/link-create → common/ui}/confirm-dismiss-dialog/messages.js +0 -0
- /package/dist/es2019/{ui/link-create → common/ui}/error-boundary/error-boundary-base/index.js +0 -0
- /package/dist/es2019/ui/{link-create → modal-create}/messages.js +0 -0
- /package/dist/esm/{ui/link-create → common/ui}/confirm-dismiss-dialog/index.js +0 -0
- /package/dist/esm/{ui/link-create → common/ui}/confirm-dismiss-dialog/messages.js +0 -0
- /package/dist/esm/{ui/link-create → common/ui}/error-boundary/error-boundary-base/index.js +0 -0
- /package/dist/esm/ui/{link-create → modal-create}/messages.js +0 -0
- /package/dist/types/{ui/link-create → common/ui}/confirm-dismiss-dialog/index.d.ts +0 -0
- /package/dist/types/{ui/link-create → common/ui}/confirm-dismiss-dialog/messages.d.ts +0 -0
- /package/dist/types/{ui/link-create → common/ui}/error-boundary/error-boundary-base/index.d.ts +0 -0
- /package/dist/types/{ui/link-create → common/ui}/error-boundary/index.d.ts +0 -0
- /package/dist/types/{controllers → common/ui}/experience-tracker/index.d.ts +0 -0
- /package/dist/types/{ui/link-create → common/ui}/modal-hero/index.d.ts +0 -0
- /package/dist/types/ui/{link-create → modal-create}/messages.d.ts +0 -0
- /package/dist/types-ts4.5/{ui/link-create → common/ui}/confirm-dismiss-dialog/index.d.ts +0 -0
- /package/dist/types-ts4.5/{ui/link-create → common/ui}/confirm-dismiss-dialog/messages.d.ts +0 -0
- /package/dist/types-ts4.5/{ui/link-create → common/ui}/error-boundary/error-boundary-base/index.d.ts +0 -0
- /package/dist/types-ts4.5/{ui/link-create → common/ui}/error-boundary/index.d.ts +0 -0
- /package/dist/types-ts4.5/{controllers → common/ui}/experience-tracker/index.d.ts +0 -0
- /package/dist/types-ts4.5/{ui/link-create → common/ui}/modal-hero/index.d.ts +0 -0
- /package/dist/types-ts4.5/ui/{link-create → modal-create}/messages.d.ts +0 -0
|
@@ -3,9 +3,15 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.LINK_CREATE_FORM_POST_CREATE_FIELD = exports.CREATE_FORM_MIN_HEIGHT_IN_PX = exports.CREATE_FORM_MAX_WIDTH_IN_PX = exports.COMPONENT_NAME = exports.ANALYTICS_CHANNEL = void 0;
|
|
6
|
+
exports.PACKAGE_DATA = exports.LINK_CREATE_FORM_POST_CREATE_FIELD = exports.CREATE_FORM_MIN_HEIGHT_IN_PX = exports.CREATE_FORM_MAX_WIDTH_IN_PX = exports.COMPONENT_NAME = exports.ANALYTICS_CHANNEL = void 0;
|
|
7
7
|
var ANALYTICS_CHANNEL = exports.ANALYTICS_CHANNEL = 'media';
|
|
8
8
|
var COMPONENT_NAME = exports.COMPONENT_NAME = 'linkCreate';
|
|
9
9
|
var CREATE_FORM_MAX_WIDTH_IN_PX = exports.CREATE_FORM_MAX_WIDTH_IN_PX = '480';
|
|
10
10
|
var CREATE_FORM_MIN_HEIGHT_IN_PX = exports.CREATE_FORM_MIN_HEIGHT_IN_PX = '200';
|
|
11
|
-
var LINK_CREATE_FORM_POST_CREATE_FIELD = exports.LINK_CREATE_FORM_POST_CREATE_FIELD = '__post_create__';
|
|
11
|
+
var LINK_CREATE_FORM_POST_CREATE_FIELD = exports.LINK_CREATE_FORM_POST_CREATE_FIELD = '__post_create__';
|
|
12
|
+
var PACKAGE_DATA = exports.PACKAGE_DATA = {
|
|
13
|
+
packageName: "@atlaskit/link-create" || '',
|
|
14
|
+
packageVersion: "2.1.0" || '',
|
|
15
|
+
component: COMPONENT_NAME,
|
|
16
|
+
componentName: COMPONENT_NAME
|
|
17
|
+
};
|
|
@@ -9,9 +9,8 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
9
9
|
var _reactIntlNext = require("react-intl-next");
|
|
10
10
|
var _analyticsNext = require("@atlaskit/analytics-next");
|
|
11
11
|
var _modalDialog = require("@atlaskit/modal-dialog");
|
|
12
|
-
var _Button = require("
|
|
13
|
-
var _ModalDialog = require("
|
|
14
|
-
var _callbackContext = require("../../../controllers/callback-context");
|
|
12
|
+
var _Button = require("../Button");
|
|
13
|
+
var _ModalDialog = require("../ModalDialog");
|
|
15
14
|
var _messages = _interopRequireDefault(require("./messages"));
|
|
16
15
|
var screen = 'linkCreateExitWarningScreen';
|
|
17
16
|
var context = {
|
|
@@ -20,10 +19,9 @@ var context = {
|
|
|
20
19
|
};
|
|
21
20
|
var ConfirmDismissDialog = exports.ConfirmDismissDialog = function ConfirmDismissDialog(_ref) {
|
|
22
21
|
var active = _ref.active,
|
|
23
|
-
onClose = _ref.onClose
|
|
22
|
+
onClose = _ref.onClose,
|
|
23
|
+
onCancel = _ref.onCancel;
|
|
24
24
|
var intl = (0, _reactIntlNext.useIntl)();
|
|
25
|
-
var _useLinkCreateCallbac = (0, _callbackContext.useLinkCreateCallback)(),
|
|
26
|
-
onCancel = _useLinkCreateCallbac.onCancel;
|
|
27
25
|
var onCancelDismiss = function onCancelDismiss() {
|
|
28
26
|
return onClose();
|
|
29
27
|
};
|
|
@@ -7,18 +7,14 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.EditModal = void 0;
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
var _modalDialog = require("@atlaskit/modal-dialog");
|
|
10
|
-
var _ModalDialog = require("
|
|
11
|
-
var _editPostCreateContext = require("../../../controllers/edit-post-create-context");
|
|
12
|
-
var _pluginContext = require("../../../controllers/plugin-context");
|
|
10
|
+
var _ModalDialog = require("../ModalDialog");
|
|
13
11
|
var SCREEN = 'linkCreateEditScreen';
|
|
14
12
|
var EditModal = exports.EditModal = function EditModal(_ref) {
|
|
15
13
|
var _activePlugin$editVie;
|
|
16
14
|
var onClose = _ref.onClose,
|
|
17
|
-
onCloseComplete = _ref.onCloseComplete
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
var _useLinkCreatePlugins = (0, _pluginContext.useLinkCreatePlugins)(),
|
|
21
|
-
activePlugin = _useLinkCreatePlugins.activePlugin;
|
|
15
|
+
onCloseComplete = _ref.onCloseComplete,
|
|
16
|
+
editViewPayload = _ref.editViewPayload,
|
|
17
|
+
activePlugin = _ref.activePlugin;
|
|
22
18
|
return /*#__PURE__*/_react.default.createElement(_modalDialog.ModalTransition, null, !!editViewPayload && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_ModalDialog.Modal, {
|
|
23
19
|
testId: "link-create-edit-modal",
|
|
24
20
|
screen: SCREEN,
|
|
@@ -11,7 +11,7 @@ var _analyticsNext = require("@atlaskit/analytics-next");
|
|
|
11
11
|
var _constants = require("../../../common/constants");
|
|
12
12
|
var _errorBoundaryUi = require("../../../common/ui/error-boundary-ui");
|
|
13
13
|
var _analytics = _interopRequireDefault(require("../../../common/utils/analytics/analytics.codegen"));
|
|
14
|
-
var _experienceTracker = require("
|
|
14
|
+
var _experienceTracker = require("../experience-tracker");
|
|
15
15
|
var _errorBoundaryBase = require("./error-boundary-base");
|
|
16
16
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
17
17
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
@@ -10,9 +10,9 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
|
|
|
10
10
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
11
|
var _analyticsNext = require("@atlaskit/analytics-next");
|
|
12
12
|
var _sentry = require("@atlaskit/linking-common/sentry");
|
|
13
|
-
var _constants = require("../../
|
|
14
|
-
var _analytics = _interopRequireDefault(require("../../
|
|
15
|
-
var _errors = require("../../
|
|
13
|
+
var _constants = require("../../constants");
|
|
14
|
+
var _analytics = _interopRequireDefault(require("../../utils/analytics/analytics.codegen"));
|
|
15
|
+
var _errors = require("../../utils/errors");
|
|
16
16
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
17
17
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
18
18
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.LinkCreateContent = void 0;
|
|
8
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
10
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
11
|
+
var LinkCreateContent = exports.LinkCreateContent = function LinkCreateContent(_ref) {
|
|
12
|
+
var plugins = _ref.plugins,
|
|
13
|
+
entityKey = _ref.entityKey;
|
|
14
|
+
var chosenOne = plugins.find(function (plugin) {
|
|
15
|
+
return plugin.key === entityKey;
|
|
16
|
+
});
|
|
17
|
+
if (!chosenOne) {
|
|
18
|
+
throw new Error('Make sure you specified a valid entityKey');
|
|
19
|
+
}
|
|
20
|
+
return /*#__PURE__*/_react.default.createElement(_react.Fragment, null, chosenOne.form);
|
|
21
|
+
};
|
|
@@ -7,11 +7,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.ModalHero = void 0;
|
|
8
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
9
9
|
var _primitives = require("@atlaskit/primitives");
|
|
10
|
-
var _errorBoundary = require("
|
|
10
|
+
var _errorBoundary = require("../../../common/ui/error-boundary");
|
|
11
11
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
12
12
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
13
|
-
// eslint-disable-next-line @atlassian/tangerine/import/no-parent-imports
|
|
14
|
-
|
|
15
13
|
var ErrorComponent = function ErrorComponent() {
|
|
16
14
|
// when there's an error, render nothing but report the issue
|
|
17
15
|
return /*#__PURE__*/_react.default.createElement(_react.Fragment, null, null);
|
|
@@ -12,9 +12,9 @@ var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/
|
|
|
12
12
|
var _react = _interopRequireWildcard(require("react"));
|
|
13
13
|
var _analyticsNext = require("@atlaskit/analytics-next");
|
|
14
14
|
var _constants = require("../../common/constants");
|
|
15
|
+
var _experienceTracker = require("../../common/ui/experience-tracker");
|
|
15
16
|
var _analytics = _interopRequireDefault(require("../../common/utils/analytics/analytics.codegen"));
|
|
16
17
|
var _errors = require("../../common/utils/errors");
|
|
17
|
-
var _experienceTracker = require("../experience-tracker");
|
|
18
18
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
19
19
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
20
20
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
package/dist/cjs/ui/index.js
CHANGED
|
@@ -13,7 +13,7 @@ Object.defineProperty(exports, "AsyncSelect", {
|
|
|
13
13
|
Object.defineProperty(exports, "CreateForm", {
|
|
14
14
|
enumerable: true,
|
|
15
15
|
get: function get() {
|
|
16
|
-
return
|
|
16
|
+
return _main.CreateForm;
|
|
17
17
|
}
|
|
18
18
|
});
|
|
19
19
|
Object.defineProperty(exports, "CreateFormLoader", {
|
|
@@ -28,6 +28,12 @@ Object.defineProperty(exports, "FormSpy", {
|
|
|
28
28
|
return _formSpy.FormSpy;
|
|
29
29
|
}
|
|
30
30
|
});
|
|
31
|
+
Object.defineProperty(exports, "InlineCreate", {
|
|
32
|
+
enumerable: true,
|
|
33
|
+
get: function get() {
|
|
34
|
+
return _inlineCreate.default;
|
|
35
|
+
}
|
|
36
|
+
});
|
|
31
37
|
Object.defineProperty(exports, "Select", {
|
|
32
38
|
enumerable: true,
|
|
33
39
|
get: function get() {
|
|
@@ -43,12 +49,13 @@ Object.defineProperty(exports, "TextField", {
|
|
|
43
49
|
Object.defineProperty(exports, "default", {
|
|
44
50
|
enumerable: true,
|
|
45
51
|
get: function get() {
|
|
46
|
-
return
|
|
52
|
+
return _modalCreate.default;
|
|
47
53
|
}
|
|
48
54
|
});
|
|
49
|
-
var
|
|
55
|
+
var _modalCreate = _interopRequireDefault(require("./modal-create"));
|
|
56
|
+
var _inlineCreate = _interopRequireDefault(require("./inline-create"));
|
|
50
57
|
var _textfield = require("./create-form/textfield");
|
|
51
|
-
var
|
|
58
|
+
var _main = require("./create-form/main");
|
|
52
59
|
var _formLoader = require("./create-form/form-loader");
|
|
53
60
|
var _select = require("./create-form/select");
|
|
54
61
|
var _asyncSelect = require("./create-form/async-select");
|
|
@@ -4,19 +4,19 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.default =
|
|
7
|
+
exports.default = void 0;
|
|
8
8
|
var _react = require("react");
|
|
9
9
|
var _react2 = require("@emotion/react");
|
|
10
10
|
var _analyticsNext = require("@atlaskit/analytics-next");
|
|
11
11
|
var _intlMessagesProvider = require("@atlaskit/intl-messages-provider");
|
|
12
|
-
var _constants = require("
|
|
13
|
-
var
|
|
14
|
-
var
|
|
15
|
-
var
|
|
16
|
-
var
|
|
17
|
-
var
|
|
18
|
-
var
|
|
19
|
-
var
|
|
12
|
+
var _constants = require("../../common/constants");
|
|
13
|
+
var _errorBoundary = require("../../common/ui/error-boundary");
|
|
14
|
+
var _errorBoundaryModal = require("../../common/ui/error-boundary-modal");
|
|
15
|
+
var _experienceTracker = require("../../common/ui/experience-tracker");
|
|
16
|
+
var _analytics = require("../../common/utils/analytics");
|
|
17
|
+
var _fetchMessagesForLocale = require("../../common/utils/locale/fetch-messages-for-locale");
|
|
18
|
+
var _en = _interopRequireDefault(require("../../i18n/en"));
|
|
19
|
+
var _main = _interopRequireDefault(require("./main"));
|
|
20
20
|
/** @jsx jsx */
|
|
21
21
|
|
|
22
22
|
var LinkCreateWithAnalyticsContext = (0, _analytics.withLinkCreateAnalyticsContext)( /*#__PURE__*/(0, _react.memo)(function (props) {
|
|
@@ -25,17 +25,11 @@ var LinkCreateWithAnalyticsContext = (0, _analytics.withLinkCreateAnalyticsConte
|
|
|
25
25
|
active: props.active,
|
|
26
26
|
onClose: props.onCancel
|
|
27
27
|
})
|
|
28
|
-
}, (0, _react2.jsx)(
|
|
28
|
+
}, (0, _react2.jsx)(_main.default, props)));
|
|
29
29
|
}));
|
|
30
|
-
var PACKAGE_DATA = exports.PACKAGE_DATA = {
|
|
31
|
-
packageName: "@atlaskit/link-create" || '',
|
|
32
|
-
packageVersion: "2.0.0" || '',
|
|
33
|
-
component: _constants.COMPONENT_NAME,
|
|
34
|
-
componentName: _constants.COMPONENT_NAME
|
|
35
|
-
};
|
|
36
30
|
var ComposedLinkCreate = /*#__PURE__*/(0, _react.memo)(function (props) {
|
|
37
31
|
return (0, _react2.jsx)(_analyticsNext.AnalyticsContext, {
|
|
38
|
-
data: PACKAGE_DATA
|
|
32
|
+
data: _constants.PACKAGE_DATA
|
|
39
33
|
}, (0, _react2.jsx)(_intlMessagesProvider.IntlMessagesProvider, {
|
|
40
34
|
defaultMessages: _en.default,
|
|
41
35
|
loaderFn: _fetchMessagesForLocale.fetchMessagesForLocale
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.default = exports.TEST_ID = void 0;
|
|
8
|
+
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
9
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
10
|
+
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
11
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
12
|
+
var _react = require("react");
|
|
13
|
+
var _react2 = require("@emotion/react");
|
|
14
|
+
var _primitives = require("@atlaskit/primitives");
|
|
15
|
+
var _confirmDismissDialog = require("../../common/ui/confirm-dismiss-dialog");
|
|
16
|
+
var _editModal = require("../../common/ui/edit-modal");
|
|
17
|
+
var _errorBoundary = require("../../common/ui/error-boundary");
|
|
18
|
+
var _linkCreateContent = require("../../common/ui/link-create-content");
|
|
19
|
+
var _callbackContext = require("../../controllers/callback-context");
|
|
20
|
+
var _editPostCreateContext = require("../../controllers/edit-post-create-context");
|
|
21
|
+
var _exitWarningModalContext = require("../../controllers/exit-warning-modal-context");
|
|
22
|
+
var _formContext = require("../../controllers/form-context");
|
|
23
|
+
var _pluginContext = require("../../controllers/plugin-context");
|
|
24
|
+
/** @jsx jsx */
|
|
25
|
+
|
|
26
|
+
var TEST_ID = exports.TEST_ID = 'link-create';
|
|
27
|
+
// todo: EDM-10075 trigger the screen.viewed_linkCreateScreen event when inline-create is mounted
|
|
28
|
+
// const SCREEN_ID = 'linkCreateScreen';
|
|
29
|
+
|
|
30
|
+
var InlineCreateContent = function InlineCreateContent(_ref) {
|
|
31
|
+
var onCreate = _ref.onCreate,
|
|
32
|
+
onFailure = _ref.onFailure,
|
|
33
|
+
onCancel = _ref.onCancel,
|
|
34
|
+
onComplete = _ref.onComplete,
|
|
35
|
+
plugins = _ref.plugins,
|
|
36
|
+
entityKey = _ref.entityKey,
|
|
37
|
+
testId = _ref.testId;
|
|
38
|
+
var _useExitWarningModal = (0, _exitWarningModalContext.useExitWarningModal)(),
|
|
39
|
+
getShouldShowWarning = _useExitWarningModal.getShouldShowWarning;
|
|
40
|
+
var _useState = (0, _react.useState)(false),
|
|
41
|
+
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
42
|
+
showExitWarning = _useState2[0],
|
|
43
|
+
setShowExitWarning = _useState2[1];
|
|
44
|
+
var _useEditPostCreateMod = (0, _editPostCreateContext.useEditPostCreateModal)(),
|
|
45
|
+
editViewPayload = _useEditPostCreateMod.editViewPayload;
|
|
46
|
+
var _useLinkCreatePlugins = (0, _pluginContext.useLinkCreatePlugins)(),
|
|
47
|
+
activePlugin = _useLinkCreatePlugins.activePlugin;
|
|
48
|
+
var handleCancel = (0, _react.useCallback)(function () {
|
|
49
|
+
if (getShouldShowWarning() && !showExitWarning) {
|
|
50
|
+
setShowExitWarning(true);
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
onCancel === null || onCancel === void 0 || onCancel();
|
|
54
|
+
}, [onCancel, getShouldShowWarning, showExitWarning]);
|
|
55
|
+
var handleCloseExitWarning = (0, _react.useCallback)(function () {
|
|
56
|
+
return setShowExitWarning(false);
|
|
57
|
+
}, []);
|
|
58
|
+
return (0, _react2.jsx)(_callbackContext.LinkCreateCallbackProvider, {
|
|
59
|
+
onCreate: onCreate,
|
|
60
|
+
onFailure: onFailure,
|
|
61
|
+
onCancel: handleCancel
|
|
62
|
+
}, (0, _react2.jsx)(_errorBoundary.ErrorBoundary, null, (0, _react2.jsx)(_primitives.Box, {
|
|
63
|
+
testId: testId
|
|
64
|
+
}, (0, _react2.jsx)(_linkCreateContent.LinkCreateContent, {
|
|
65
|
+
plugins: plugins,
|
|
66
|
+
entityKey: entityKey
|
|
67
|
+
}))), onComplete && (0, _react2.jsx)(_editModal.EditModal, {
|
|
68
|
+
onClose: onComplete,
|
|
69
|
+
editViewPayload: editViewPayload,
|
|
70
|
+
activePlugin: activePlugin
|
|
71
|
+
}), (0, _react2.jsx)(_confirmDismissDialog.ConfirmDismissDialog, {
|
|
72
|
+
active: showExitWarning,
|
|
73
|
+
onClose: handleCloseExitWarning,
|
|
74
|
+
onCancel: onCancel
|
|
75
|
+
}));
|
|
76
|
+
};
|
|
77
|
+
var InlineCreate = function InlineCreate(props) {
|
|
78
|
+
return (0, _react2.jsx)(_pluginContext.LinkCreatePluginsProvider, {
|
|
79
|
+
plugins: props.plugins,
|
|
80
|
+
entityKey: props.entityKey
|
|
81
|
+
}, function (pluginsProvider) {
|
|
82
|
+
return (0, _react2.jsx)(_editPostCreateContext.EditPostCreateModalProvider, {
|
|
83
|
+
active: true
|
|
84
|
+
}, function (_ref2) {
|
|
85
|
+
var _pluginsProvider$acti;
|
|
86
|
+
var setEditViewPayload = _ref2.setEditViewPayload,
|
|
87
|
+
shouldActivateEditView = _ref2.shouldActivateEditView,
|
|
88
|
+
enableEditView = _ref2.enableEditView;
|
|
89
|
+
return (0, _react2.jsx)(_formContext.FormContextProvider, {
|
|
90
|
+
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
|
|
91
|
+
}, (0, _react2.jsx)(_exitWarningModalContext.ExitWarningModalProvider, null, (0, _react2.jsx)(InlineCreateContent, (0, _extends2.default)({}, props, {
|
|
92
|
+
onCreate: ( /*#__PURE__*/function () {
|
|
93
|
+
var _ref3 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(payload) {
|
|
94
|
+
var _props$onCreate;
|
|
95
|
+
return _regenerator.default.wrap(function _callee$(_context) {
|
|
96
|
+
while (1) switch (_context.prev = _context.next) {
|
|
97
|
+
case 0:
|
|
98
|
+
_context.next = 2;
|
|
99
|
+
return (_props$onCreate = props.onCreate) === null || _props$onCreate === void 0 ? void 0 : _props$onCreate.call(props, payload);
|
|
100
|
+
case 2:
|
|
101
|
+
// if onComplete exists then there is an edit flow
|
|
102
|
+
if (props.onComplete) {
|
|
103
|
+
if (shouldActivateEditView()) {
|
|
104
|
+
//edit button is pressed
|
|
105
|
+
setEditViewPayload(payload);
|
|
106
|
+
} else {
|
|
107
|
+
//create button is pressed
|
|
108
|
+
props.onComplete();
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
case 3:
|
|
112
|
+
case "end":
|
|
113
|
+
return _context.stop();
|
|
114
|
+
}
|
|
115
|
+
}, _callee);
|
|
116
|
+
}));
|
|
117
|
+
return function (_x) {
|
|
118
|
+
return _ref3.apply(this, arguments);
|
|
119
|
+
};
|
|
120
|
+
}())
|
|
121
|
+
}))));
|
|
122
|
+
});
|
|
123
|
+
});
|
|
124
|
+
};
|
|
125
|
+
var _default = exports.default = InlineCreate;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.default = void 0;
|
|
8
|
+
var _react = require("react");
|
|
9
|
+
var _react2 = require("@emotion/react");
|
|
10
|
+
var _analyticsNext = require("@atlaskit/analytics-next");
|
|
11
|
+
var _intlMessagesProvider = require("@atlaskit/intl-messages-provider");
|
|
12
|
+
var _constants = require("../../common/constants");
|
|
13
|
+
var _errorBoundary = require("../../common/ui/error-boundary");
|
|
14
|
+
var _errorBoundaryModal = require("../../common/ui/error-boundary-modal");
|
|
15
|
+
var _experienceTracker = require("../../common/ui/experience-tracker");
|
|
16
|
+
var _analytics = require("../../common/utils/analytics");
|
|
17
|
+
var _fetchMessagesForLocale = require("../../common/utils/locale/fetch-messages-for-locale");
|
|
18
|
+
var _en = _interopRequireDefault(require("../../i18n/en"));
|
|
19
|
+
var _main = _interopRequireDefault(require("./main"));
|
|
20
|
+
/** @jsx jsx */
|
|
21
|
+
|
|
22
|
+
var LinkCreateWithAnalyticsContext = (0, _analytics.withLinkCreateAnalyticsContext)( /*#__PURE__*/(0, _react.memo)(function (props) {
|
|
23
|
+
return (0, _react2.jsx)(_experienceTracker.Experience, null, (0, _react2.jsx)(_errorBoundary.ErrorBoundary, {
|
|
24
|
+
errorComponent: (0, _react2.jsx)(_errorBoundaryModal.ErrorBoundaryModal, {
|
|
25
|
+
active: props.active,
|
|
26
|
+
onClose: props.onCancel
|
|
27
|
+
})
|
|
28
|
+
}, (0, _react2.jsx)(_main.default, props)));
|
|
29
|
+
}));
|
|
30
|
+
var ComposedLinkCreate = /*#__PURE__*/(0, _react.memo)(function (props) {
|
|
31
|
+
return (0, _react2.jsx)(_analyticsNext.AnalyticsContext, {
|
|
32
|
+
data: _constants.PACKAGE_DATA
|
|
33
|
+
}, (0, _react2.jsx)(_intlMessagesProvider.IntlMessagesProvider, {
|
|
34
|
+
defaultMessages: _en.default,
|
|
35
|
+
loaderFn: _fetchMessagesForLocale.fetchMessagesForLocale
|
|
36
|
+
}, (0, _react2.jsx)(LinkCreateWithAnalyticsContext, props)));
|
|
37
|
+
});
|
|
38
|
+
var _default = exports.default = ComposedLinkCreate;
|
|
@@ -15,46 +15,36 @@ var _reactIntlNext = require("react-intl-next");
|
|
|
15
15
|
var _modalDialog = require("@atlaskit/modal-dialog");
|
|
16
16
|
var _primitives = require("@atlaskit/primitives");
|
|
17
17
|
var _constants = require("../../common/constants");
|
|
18
|
+
var _confirmDismissDialog = require("../../common/ui/confirm-dismiss-dialog");
|
|
19
|
+
var _editModal = require("../../common/ui/edit-modal");
|
|
20
|
+
var _errorBoundary = require("../../common/ui/error-boundary");
|
|
21
|
+
var _linkCreateContent = require("../../common/ui/link-create-content");
|
|
22
|
+
var _modalHero = require("../../common/ui/modal-hero");
|
|
18
23
|
var _ModalDialog = require("../../common/ui/ModalDialog");
|
|
19
24
|
var _callbackContext = require("../../controllers/callback-context");
|
|
20
25
|
var _editPostCreateContext = require("../../controllers/edit-post-create-context");
|
|
21
26
|
var _exitWarningModalContext = require("../../controllers/exit-warning-modal-context");
|
|
22
27
|
var _formContext = require("../../controllers/form-context");
|
|
23
28
|
var _pluginContext = require("../../controllers/plugin-context");
|
|
24
|
-
var _confirmDismissDialog = require("./confirm-dismiss-dialog");
|
|
25
|
-
var _editModal = require("./edit-modal");
|
|
26
|
-
var _errorBoundary = require("./error-boundary");
|
|
27
29
|
var _messages = require("./messages");
|
|
28
|
-
var _modalHero = require("./modal-hero");
|
|
29
30
|
/** @jsx jsx */
|
|
30
31
|
|
|
31
32
|
var TEST_ID = exports.TEST_ID = 'link-create';
|
|
32
33
|
var SCREEN_ID = 'linkCreateScreen';
|
|
33
|
-
var
|
|
34
|
-
var
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
onCreate = _ref2.onCreate,
|
|
48
|
-
onFailure = _ref2.onFailure,
|
|
49
|
-
onCancel = _ref2.onCancel,
|
|
50
|
-
onComplete = _ref2.onComplete,
|
|
51
|
-
onOpenComplete = _ref2.onOpenComplete,
|
|
52
|
-
onCloseComplete = _ref2.onCloseComplete,
|
|
53
|
-
_ref2$testId = _ref2.testId,
|
|
54
|
-
testId = _ref2$testId === void 0 ? TEST_ID : _ref2$testId,
|
|
55
|
-
plugins = _ref2.plugins,
|
|
56
|
-
entityKey = _ref2.entityKey,
|
|
57
|
-
modalHero = _ref2.modalHero;
|
|
34
|
+
var LinkCreateWithModal = function LinkCreateWithModal(_ref) {
|
|
35
|
+
var active = _ref.active,
|
|
36
|
+
modalTitle = _ref.modalTitle,
|
|
37
|
+
onCreate = _ref.onCreate,
|
|
38
|
+
onFailure = _ref.onFailure,
|
|
39
|
+
onCancel = _ref.onCancel,
|
|
40
|
+
onComplete = _ref.onComplete,
|
|
41
|
+
onOpenComplete = _ref.onOpenComplete,
|
|
42
|
+
onCloseComplete = _ref.onCloseComplete,
|
|
43
|
+
_ref$testId = _ref.testId,
|
|
44
|
+
testId = _ref$testId === void 0 ? TEST_ID : _ref$testId,
|
|
45
|
+
plugins = _ref.plugins,
|
|
46
|
+
entityKey = _ref.entityKey,
|
|
47
|
+
modalHero = _ref.modalHero;
|
|
58
48
|
var intl = (0, _reactIntlNext.useIntl)();
|
|
59
49
|
var _useExitWarningModal = (0, _exitWarningModalContext.useExitWarningModal)(),
|
|
60
50
|
getShouldShowWarning = _useExitWarningModal.getShouldShowWarning;
|
|
@@ -62,6 +52,10 @@ var LinkCreateWithModal = function LinkCreateWithModal(_ref2) {
|
|
|
62
52
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
63
53
|
showExitWarning = _useState2[0],
|
|
64
54
|
setShowExitWarning = _useState2[1];
|
|
55
|
+
var _useEditPostCreateMod = (0, _editPostCreateContext.useEditPostCreateModal)(),
|
|
56
|
+
editViewPayload = _useEditPostCreateMod.editViewPayload;
|
|
57
|
+
var _useLinkCreatePlugins = (0, _pluginContext.useLinkCreatePlugins)(),
|
|
58
|
+
activePlugin = _useLinkCreatePlugins.activePlugin;
|
|
65
59
|
var handleCancel = (0, _react.useCallback)(function () {
|
|
66
60
|
if (getShouldShowWarning() && !showExitWarning) {
|
|
67
61
|
setShowExitWarning(true);
|
|
@@ -88,15 +82,18 @@ var LinkCreateWithModal = function LinkCreateWithModal(_ref2) {
|
|
|
88
82
|
hero: modalHero
|
|
89
83
|
}), (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)(_primitives.Box, {
|
|
90
84
|
testId: testId
|
|
91
|
-
}, (0, _react2.jsx)(_errorBoundary.ErrorBoundary, null, (0, _react2.jsx)(LinkCreateContent, {
|
|
85
|
+
}, (0, _react2.jsx)(_errorBoundary.ErrorBoundary, null, (0, _react2.jsx)(_linkCreateContent.LinkCreateContent, {
|
|
92
86
|
plugins: plugins,
|
|
93
87
|
entityKey: entityKey
|
|
94
88
|
})))))), onComplete && (0, _react2.jsx)(_editModal.EditModal, {
|
|
95
89
|
onCloseComplete: onCloseComplete,
|
|
96
|
-
onClose: onComplete
|
|
90
|
+
onClose: onComplete,
|
|
91
|
+
editViewPayload: editViewPayload,
|
|
92
|
+
activePlugin: activePlugin
|
|
97
93
|
}), (0, _react2.jsx)(_confirmDismissDialog.ConfirmDismissDialog, {
|
|
98
94
|
active: showExitWarning,
|
|
99
|
-
onClose: handleCloseExitWarning
|
|
95
|
+
onClose: handleCloseExitWarning,
|
|
96
|
+
onCancel: onCancel
|
|
100
97
|
}));
|
|
101
98
|
};
|
|
102
99
|
var LinkCreateModal = function LinkCreateModal(props) {
|
|
@@ -115,18 +112,18 @@ var LinkCreateModal = function LinkCreateModal(props) {
|
|
|
115
112
|
}, function (pluginsProvider) {
|
|
116
113
|
return (0, _react2.jsx)(_editPostCreateContext.EditPostCreateModalProvider, {
|
|
117
114
|
active: !!props.active
|
|
118
|
-
}, function (
|
|
115
|
+
}, function (_ref2) {
|
|
119
116
|
var _pluginsProvider$acti;
|
|
120
|
-
var setEditViewPayload =
|
|
121
|
-
editViewPayload =
|
|
122
|
-
shouldActivateEditView =
|
|
123
|
-
enableEditView =
|
|
117
|
+
var setEditViewPayload = _ref2.setEditViewPayload,
|
|
118
|
+
editViewPayload = _ref2.editViewPayload,
|
|
119
|
+
shouldActivateEditView = _ref2.shouldActivateEditView,
|
|
120
|
+
enableEditView = _ref2.enableEditView;
|
|
124
121
|
return (0, _react2.jsx)(_formContext.FormContextProvider, {
|
|
125
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
|
|
126
123
|
}, (0, _react2.jsx)(_exitWarningModalContext.ExitWarningModalProvider, null, (0, _react2.jsx)(LinkCreateWithModal, (0, _extends2.default)({}, props, {
|
|
127
124
|
active: props.active && !editViewPayload,
|
|
128
125
|
onCreate: ( /*#__PURE__*/function () {
|
|
129
|
-
var
|
|
126
|
+
var _ref3 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(payload) {
|
|
130
127
|
var _props$onCreate;
|
|
131
128
|
return _regenerator.default.wrap(function _callee$(_context) {
|
|
132
129
|
while (1) switch (_context.prev = _context.next) {
|
|
@@ -151,7 +148,7 @@ var LinkCreateModal = function LinkCreateModal(props) {
|
|
|
151
148
|
}, _callee);
|
|
152
149
|
}));
|
|
153
150
|
return function (_x) {
|
|
154
|
-
return
|
|
151
|
+
return _ref3.apply(this, arguments);
|
|
155
152
|
};
|
|
156
153
|
}()),
|
|
157
154
|
onCloseComplete: function onCloseComplete() {
|
|
@@ -2,4 +2,10 @@ export const ANALYTICS_CHANNEL = 'media';
|
|
|
2
2
|
export const COMPONENT_NAME = 'linkCreate';
|
|
3
3
|
export const CREATE_FORM_MAX_WIDTH_IN_PX = '480';
|
|
4
4
|
export const CREATE_FORM_MIN_HEIGHT_IN_PX = '200';
|
|
5
|
-
export const LINK_CREATE_FORM_POST_CREATE_FIELD = '__post_create__';
|
|
5
|
+
export const LINK_CREATE_FORM_POST_CREATE_FIELD = '__post_create__';
|
|
6
|
+
export const PACKAGE_DATA = {
|
|
7
|
+
packageName: "@atlaskit/link-create" || '',
|
|
8
|
+
packageVersion: "2.1.0" || '',
|
|
9
|
+
component: COMPONENT_NAME,
|
|
10
|
+
componentName: COMPONENT_NAME
|
|
11
|
+
};
|
|
@@ -2,9 +2,8 @@ import React from 'react';
|
|
|
2
2
|
import { useIntl } from 'react-intl-next';
|
|
3
3
|
import { AnalyticsContext } from '@atlaskit/analytics-next';
|
|
4
4
|
import { ModalBody, ModalFooter, ModalHeader, ModalTitle, ModalTransition } from '@atlaskit/modal-dialog';
|
|
5
|
-
import { Button } from '
|
|
6
|
-
import { Modal } from '
|
|
7
|
-
import { useLinkCreateCallback } from '../../../controllers/callback-context';
|
|
5
|
+
import { Button } from '../Button';
|
|
6
|
+
import { Modal } from '../ModalDialog';
|
|
8
7
|
import messages from './messages';
|
|
9
8
|
const screen = 'linkCreateExitWarningScreen';
|
|
10
9
|
const context = {
|
|
@@ -13,12 +12,10 @@ const context = {
|
|
|
13
12
|
};
|
|
14
13
|
export const ConfirmDismissDialog = ({
|
|
15
14
|
active,
|
|
16
|
-
onClose
|
|
15
|
+
onClose,
|
|
16
|
+
onCancel
|
|
17
17
|
}) => {
|
|
18
18
|
const intl = useIntl();
|
|
19
|
-
const {
|
|
20
|
-
onCancel
|
|
21
|
-
} = useLinkCreateCallback();
|
|
22
19
|
const onCancelDismiss = () => onClose();
|
|
23
20
|
const onConfirmDismiss = () => {
|
|
24
21
|
onClose();
|
|
@@ -1,20 +1,14 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { ModalTransition } from '@atlaskit/modal-dialog';
|
|
3
|
-
import { Modal } from '
|
|
4
|
-
import { useEditPostCreateModal } from '../../../controllers/edit-post-create-context';
|
|
5
|
-
import { useLinkCreatePlugins } from '../../../controllers/plugin-context';
|
|
3
|
+
import { Modal } from '../ModalDialog';
|
|
6
4
|
const SCREEN = 'linkCreateEditScreen';
|
|
7
5
|
export const EditModal = ({
|
|
8
6
|
onClose,
|
|
9
|
-
onCloseComplete
|
|
7
|
+
onCloseComplete,
|
|
8
|
+
editViewPayload,
|
|
9
|
+
activePlugin
|
|
10
10
|
}) => {
|
|
11
11
|
var _activePlugin$editVie;
|
|
12
|
-
const {
|
|
13
|
-
editViewPayload
|
|
14
|
-
} = useEditPostCreateModal();
|
|
15
|
-
const {
|
|
16
|
-
activePlugin
|
|
17
|
-
} = useLinkCreatePlugins();
|
|
18
12
|
return /*#__PURE__*/React.createElement(ModalTransition, null, !!editViewPayload && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Modal, {
|
|
19
13
|
testId: "link-create-edit-modal",
|
|
20
14
|
screen: SCREEN,
|
|
@@ -3,7 +3,7 @@ import { useAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
|
3
3
|
import { ANALYTICS_CHANNEL } from '../../../common/constants';
|
|
4
4
|
import { ErrorBoundaryUI } from '../../../common/ui/error-boundary-ui';
|
|
5
5
|
import createEventPayload from '../../../common/utils/analytics/analytics.codegen';
|
|
6
|
-
import { useExperience } from '
|
|
6
|
+
import { useExperience } from '../experience-tracker';
|
|
7
7
|
import { BaseErrorBoundary } from './error-boundary-base';
|
|
8
8
|
export const ErrorBoundary = ({
|
|
9
9
|
children,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React, { createContext, useContext, useMemo, useRef } from 'react';
|
|
2
2
|
import { useAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
3
3
|
import { captureException } from '@atlaskit/linking-common/sentry';
|
|
4
|
-
import { ANALYTICS_CHANNEL } from '../../
|
|
5
|
-
import createEventPayload from '../../
|
|
6
|
-
import { getErrorType, getNetworkFields } from '../../
|
|
4
|
+
import { ANALYTICS_CHANNEL } from '../../constants';
|
|
5
|
+
import createEventPayload from '../../utils/analytics/analytics.codegen';
|
|
6
|
+
import { getErrorType, getNetworkFields } from '../../utils/errors';
|
|
7
7
|
const ExperienceContext = /*#__PURE__*/createContext({
|
|
8
8
|
success: () => {},
|
|
9
9
|
failure: () => {}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React, { Fragment } from 'react';
|
|
2
|
+
export const LinkCreateContent = ({
|
|
3
|
+
plugins,
|
|
4
|
+
entityKey
|
|
5
|
+
}) => {
|
|
6
|
+
const chosenOne = plugins.find(plugin => plugin.key === entityKey);
|
|
7
|
+
if (!chosenOne) {
|
|
8
|
+
throw new Error('Make sure you specified a valid entityKey');
|
|
9
|
+
}
|
|
10
|
+
return /*#__PURE__*/React.createElement(Fragment, null, chosenOne.form);
|
|
11
|
+
};
|