@atlaskit/link-create 2.2.0 → 2.4.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 +26 -0
- package/LICENSE.md +6 -8
- package/dist/cjs/common/constants.js +4 -2
- package/dist/cjs/ui/create-form/user-picker/main.js +1 -1
- package/dist/cjs/ui/inline-create/index.js +1 -7
- package/dist/cjs/ui/inline-create/inline-analytics/index.js +22 -0
- package/dist/cjs/ui/inline-create/main.js +9 -8
- package/dist/cjs/ui/modal-create/main.js +3 -5
- package/dist/es2019/common/constants.js +3 -1
- package/dist/es2019/ui/create-form/user-picker/main.js +1 -1
- package/dist/es2019/ui/inline-create/index.js +1 -7
- package/dist/es2019/ui/inline-create/inline-analytics/index.js +14 -0
- package/dist/es2019/ui/inline-create/main.js +8 -10
- package/dist/es2019/ui/modal-create/main.js +2 -4
- package/dist/esm/common/constants.js +3 -1
- package/dist/esm/ui/create-form/user-picker/main.js +1 -1
- package/dist/esm/ui/inline-create/index.js +1 -7
- package/dist/esm/ui/inline-create/inline-analytics/index.js +15 -0
- package/dist/esm/ui/inline-create/main.js +9 -10
- package/dist/esm/ui/modal-create/main.js +2 -4
- package/dist/types/common/constants.d.ts +2 -0
- package/dist/types/common/ui/error-boundary-modal/index.d.ts +1 -1
- package/dist/types/ui/inline-create/inline-analytics/index.d.ts +9 -0
- package/dist/types/ui/inline-create/main.d.ts +0 -1
- package/dist/types/ui/modal-create/main.d.ts +0 -1
- package/dist/types-ts4.5/common/constants.d.ts +2 -0
- package/dist/types-ts4.5/common/ui/error-boundary-modal/index.d.ts +1 -1
- package/dist/types-ts4.5/ui/inline-create/inline-analytics/index.d.ts +9 -0
- package/dist/types-ts4.5/ui/inline-create/main.d.ts +0 -1
- package/dist/types-ts4.5/ui/modal-create/main.d.ts +0 -1
- package/package.json +2 -2
- package/report.api.md +103 -111
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,31 @@
|
|
|
1
1
|
# @atlaskit/link-create
|
|
2
2
|
|
|
3
|
+
## 2.4.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#108443](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/108443)
|
|
8
|
+
[`457df84a02af1`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/457df84a02af1) -
|
|
9
|
+
[ux] ErrorBoundary outside InlineCreate displays error inline
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- Updated dependencies
|
|
14
|
+
|
|
15
|
+
## 2.3.0
|
|
16
|
+
|
|
17
|
+
### Minor Changes
|
|
18
|
+
|
|
19
|
+
- [#107796](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/107796)
|
|
20
|
+
[`15f419051682`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/15f419051682) -
|
|
21
|
+
Fire screen viewed analytics event for Inline Create
|
|
22
|
+
|
|
23
|
+
### Patch Changes
|
|
24
|
+
|
|
25
|
+
- [#107877](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/107877)
|
|
26
|
+
[`3f82794369ce`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/3f82794369ce) -
|
|
27
|
+
Internal changes to types. No expected functional changes.
|
|
28
|
+
|
|
3
29
|
## 2.2.0
|
|
4
30
|
|
|
5
31
|
### Minor Changes
|
package/LICENSE.md
CHANGED
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
Copyright 2022 Atlassian Pty Ltd
|
|
2
2
|
|
|
3
|
-
Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
-
|
|
5
|
-
You may obtain a copy of the License at
|
|
3
|
+
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in
|
|
4
|
+
compliance with the License. You may obtain a copy of the License at
|
|
6
5
|
|
|
7
6
|
http://www.apache.org/licenses/LICENSE-2.0
|
|
8
7
|
|
|
9
|
-
Unless required by applicable law or agreed to in writing, software
|
|
10
|
-
distributed
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
limitations under the License.
|
|
8
|
+
Unless required by applicable law or agreed to in writing, software distributed under the License is
|
|
9
|
+
distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
10
|
+
implied. See the License for the specific language governing permissions and limitations under the
|
|
11
|
+
License.
|
|
@@ -3,15 +3,17 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
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;
|
|
6
|
+
exports.SCREEN_ID = exports.PACKAGE_DATA = exports.LINK_CREATE_FORM_POST_CREATE_FIELD = exports.DEFAULT_TEST_ID = 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
|
+
var SCREEN_ID = exports.SCREEN_ID = 'linkCreateScreen';
|
|
10
|
+
var DEFAULT_TEST_ID = exports.DEFAULT_TEST_ID = 'link-create';
|
|
9
11
|
var CREATE_FORM_MAX_WIDTH_IN_PX = exports.CREATE_FORM_MAX_WIDTH_IN_PX = '480';
|
|
10
12
|
var CREATE_FORM_MIN_HEIGHT_IN_PX = exports.CREATE_FORM_MIN_HEIGHT_IN_PX = '200';
|
|
11
13
|
var LINK_CREATE_FORM_POST_CREATE_FIELD = exports.LINK_CREATE_FORM_POST_CREATE_FIELD = '__post_create__';
|
|
12
14
|
var PACKAGE_DATA = exports.PACKAGE_DATA = {
|
|
13
15
|
packageName: "@atlaskit/link-create" || '',
|
|
14
|
-
packageVersion: "2.
|
|
16
|
+
packageVersion: "2.4.0" || '',
|
|
15
17
|
component: COMPONENT_NAME,
|
|
16
18
|
componentName: COMPONENT_NAME
|
|
17
19
|
};
|
|
@@ -14,7 +14,7 @@ var _excluded = ["fieldId"];
|
|
|
14
14
|
/** @jsx jsx */
|
|
15
15
|
var TEST_ID = exports.TEST_ID = 'link-create-user-picker';
|
|
16
16
|
var DEFAULT_DEBOUNCE_TIME = 400;
|
|
17
|
-
var UserPickerWidth =
|
|
17
|
+
var UserPickerWidth = '100%';
|
|
18
18
|
|
|
19
19
|
/**
|
|
20
20
|
* A user picker utilising the SmartUserPicker.
|
|
@@ -11,7 +11,6 @@ var _analyticsNext = require("@atlaskit/analytics-next");
|
|
|
11
11
|
var _intlMessagesProvider = require("@atlaskit/intl-messages-provider");
|
|
12
12
|
var _constants = require("../../common/constants");
|
|
13
13
|
var _errorBoundary = require("../../common/ui/error-boundary");
|
|
14
|
-
var _errorBoundaryModal = require("../../common/ui/error-boundary-modal");
|
|
15
14
|
var _experienceTracker = require("../../common/ui/experience-tracker");
|
|
16
15
|
var _analytics = require("../../common/utils/analytics");
|
|
17
16
|
var _fetchMessagesForLocale = require("../../common/utils/locale/fetch-messages-for-locale");
|
|
@@ -20,12 +19,7 @@ var _main = _interopRequireDefault(require("./main"));
|
|
|
20
19
|
/** @jsx jsx */
|
|
21
20
|
|
|
22
21
|
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)));
|
|
22
|
+
return (0, _react2.jsx)(_experienceTracker.Experience, null, (0, _react2.jsx)(_errorBoundary.ErrorBoundary, null, (0, _react2.jsx)(_main.default, props)));
|
|
29
23
|
}));
|
|
30
24
|
var ComposedLinkCreate = /*#__PURE__*/(0, _react.memo)(function (props) {
|
|
31
25
|
return (0, _react2.jsx)(_analyticsNext.AnalyticsContext, {
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.InlineAnalytics = void 0;
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
var _analyticsNext = require("@atlaskit/analytics-next");
|
|
10
|
+
var _components = require("../../..//common/utils/analytics/components");
|
|
11
|
+
var InlineAnalytics = exports.InlineAnalytics = function InlineAnalytics(_ref) {
|
|
12
|
+
var screen = _ref.screen,
|
|
13
|
+
children = _ref.children;
|
|
14
|
+
return /*#__PURE__*/_react.default.createElement(_analyticsNext.AnalyticsContext, {
|
|
15
|
+
data: {
|
|
16
|
+
source: screen,
|
|
17
|
+
component: 'inline-create'
|
|
18
|
+
}
|
|
19
|
+
}, /*#__PURE__*/_react.default.createElement(_components.ScreenViewedEvent, {
|
|
20
|
+
screen: screen
|
|
21
|
+
}), children);
|
|
22
|
+
};
|
|
@@ -4,7 +4,7 @@ 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 _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
9
9
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
10
10
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
@@ -12,6 +12,7 @@ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/sli
|
|
|
12
12
|
var _react = require("react");
|
|
13
13
|
var _react2 = require("@emotion/react");
|
|
14
14
|
var _primitives = require("@atlaskit/primitives");
|
|
15
|
+
var _constants = require("../../common/constants");
|
|
15
16
|
var _confirmDismissDialog = require("../../common/ui/confirm-dismiss-dialog");
|
|
16
17
|
var _editModal = require("../../common/ui/edit-modal");
|
|
17
18
|
var _errorBoundary = require("../../common/ui/error-boundary");
|
|
@@ -21,12 +22,9 @@ var _editPostCreateContext = require("../../controllers/edit-post-create-context
|
|
|
21
22
|
var _exitWarningModalContext = require("../../controllers/exit-warning-modal-context");
|
|
22
23
|
var _formContext = require("../../controllers/form-context");
|
|
23
24
|
var _pluginContext = require("../../controllers/plugin-context");
|
|
25
|
+
var _inlineAnalytics = require("./inline-analytics");
|
|
24
26
|
/** @jsx jsx */
|
|
25
27
|
|
|
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
28
|
var InlineCreateContent = function InlineCreateContent(_ref) {
|
|
31
29
|
var onCreate = _ref.onCreate,
|
|
32
30
|
onFailure = _ref.onFailure,
|
|
@@ -34,7 +32,8 @@ var InlineCreateContent = function InlineCreateContent(_ref) {
|
|
|
34
32
|
onComplete = _ref.onComplete,
|
|
35
33
|
plugins = _ref.plugins,
|
|
36
34
|
entityKey = _ref.entityKey,
|
|
37
|
-
testId = _ref.testId
|
|
35
|
+
_ref$testId = _ref.testId,
|
|
36
|
+
testId = _ref$testId === void 0 ? _constants.DEFAULT_TEST_ID : _ref$testId;
|
|
38
37
|
var _useExitWarningModal = (0, _exitWarningModalContext.useExitWarningModal)(),
|
|
39
38
|
getShouldShowWarning = _useExitWarningModal.getShouldShowWarning;
|
|
40
39
|
var _useState = (0, _react.useState)(false),
|
|
@@ -59,12 +58,14 @@ var InlineCreateContent = function InlineCreateContent(_ref) {
|
|
|
59
58
|
onCreate: onCreate,
|
|
60
59
|
onFailure: onFailure,
|
|
61
60
|
onCancel: handleCancel
|
|
62
|
-
}, (0, _react2.jsx)(_errorBoundary.ErrorBoundary, null, (0, _react2.jsx)(
|
|
61
|
+
}, (0, _react2.jsx)(_errorBoundary.ErrorBoundary, null, (0, _react2.jsx)(_inlineAnalytics.InlineAnalytics, {
|
|
62
|
+
screen: _constants.SCREEN_ID
|
|
63
|
+
}, (0, _react2.jsx)(_primitives.Box, {
|
|
63
64
|
testId: testId
|
|
64
65
|
}, (0, _react2.jsx)(_linkCreateContent.LinkCreateContent, {
|
|
65
66
|
plugins: plugins,
|
|
66
67
|
entityKey: entityKey
|
|
67
|
-
}))), onComplete && (0, _react2.jsx)(_editModal.EditModal, {
|
|
68
|
+
})))), onComplete && (0, _react2.jsx)(_editModal.EditModal, {
|
|
68
69
|
onClose: onComplete,
|
|
69
70
|
editViewPayload: editViewPayload,
|
|
70
71
|
activePlugin: activePlugin
|
|
@@ -4,7 +4,7 @@ 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 _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
9
9
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
10
10
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
@@ -29,8 +29,6 @@ var _pluginContext = require("../../controllers/plugin-context");
|
|
|
29
29
|
var _messages = require("./messages");
|
|
30
30
|
/** @jsx jsx */
|
|
31
31
|
|
|
32
|
-
var TEST_ID = exports.TEST_ID = 'link-create';
|
|
33
|
-
var SCREEN_ID = 'linkCreateScreen';
|
|
34
32
|
var LinkCreateWithModal = function LinkCreateWithModal(_ref) {
|
|
35
33
|
var active = _ref.active,
|
|
36
34
|
modalTitle = _ref.modalTitle,
|
|
@@ -41,7 +39,7 @@ var LinkCreateWithModal = function LinkCreateWithModal(_ref) {
|
|
|
41
39
|
onOpenComplete = _ref.onOpenComplete,
|
|
42
40
|
onCloseComplete = _ref.onCloseComplete,
|
|
43
41
|
_ref$testId = _ref.testId,
|
|
44
|
-
testId = _ref$testId === void 0 ?
|
|
42
|
+
testId = _ref$testId === void 0 ? _constants.DEFAULT_TEST_ID : _ref$testId,
|
|
45
43
|
plugins = _ref.plugins,
|
|
46
44
|
entityKey = _ref.entityKey,
|
|
47
45
|
modalHero = _ref.modalHero;
|
|
@@ -72,7 +70,7 @@ var LinkCreateWithModal = function LinkCreateWithModal(_ref) {
|
|
|
72
70
|
onCancel: handleCancel
|
|
73
71
|
}, (0, _react2.jsx)(_modalDialog.ModalTransition, null, active && (0, _react2.jsx)(_ModalDialog.Modal, {
|
|
74
72
|
testId: "link-create-modal",
|
|
75
|
-
screen: SCREEN_ID,
|
|
73
|
+
screen: _constants.SCREEN_ID,
|
|
76
74
|
onClose: handleCancel,
|
|
77
75
|
shouldScrollInViewport: true,
|
|
78
76
|
onOpenComplete: onOpenComplete,
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
export const ANALYTICS_CHANNEL = 'media';
|
|
2
2
|
export const COMPONENT_NAME = 'linkCreate';
|
|
3
|
+
export const SCREEN_ID = 'linkCreateScreen';
|
|
4
|
+
export const DEFAULT_TEST_ID = 'link-create';
|
|
3
5
|
export const CREATE_FORM_MAX_WIDTH_IN_PX = '480';
|
|
4
6
|
export const CREATE_FORM_MIN_HEIGHT_IN_PX = '200';
|
|
5
7
|
export const LINK_CREATE_FORM_POST_CREATE_FIELD = '__post_create__';
|
|
6
8
|
export const PACKAGE_DATA = {
|
|
7
9
|
packageName: "@atlaskit/link-create" || '',
|
|
8
|
-
packageVersion: "2.
|
|
10
|
+
packageVersion: "2.4.0" || '',
|
|
9
11
|
component: COMPONENT_NAME,
|
|
10
12
|
componentName: COMPONENT_NAME
|
|
11
13
|
};
|
|
@@ -4,7 +4,7 @@ import SmartUserPicker from '@atlaskit/smart-user-picker';
|
|
|
4
4
|
import { CreateField } from '../../../controllers/create-field';
|
|
5
5
|
export const TEST_ID = 'link-create-user-picker';
|
|
6
6
|
const DEFAULT_DEBOUNCE_TIME = 400;
|
|
7
|
-
const UserPickerWidth =
|
|
7
|
+
const UserPickerWidth = '100%';
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* A user picker utilising the SmartUserPicker.
|
|
@@ -5,19 +5,13 @@ import { AnalyticsContext } from '@atlaskit/analytics-next';
|
|
|
5
5
|
import { IntlMessagesProvider } from '@atlaskit/intl-messages-provider';
|
|
6
6
|
import { PACKAGE_DATA } from '../../common/constants';
|
|
7
7
|
import { ErrorBoundary } from '../../common/ui/error-boundary';
|
|
8
|
-
import { ErrorBoundaryModal } from '../../common/ui/error-boundary-modal';
|
|
9
8
|
import { Experience } from '../../common/ui/experience-tracker';
|
|
10
9
|
import { withLinkCreateAnalyticsContext } from '../../common/utils/analytics';
|
|
11
10
|
import { fetchMessagesForLocale } from '../../common/utils/locale/fetch-messages-for-locale';
|
|
12
11
|
import i18nEN from '../../i18n/en';
|
|
13
12
|
import InlineCreate from './main';
|
|
14
13
|
const LinkCreateWithAnalyticsContext = withLinkCreateAnalyticsContext( /*#__PURE__*/memo(props => {
|
|
15
|
-
return jsx(Experience, null, jsx(ErrorBoundary,
|
|
16
|
-
errorComponent: jsx(ErrorBoundaryModal, {
|
|
17
|
-
active: props.active,
|
|
18
|
-
onClose: props.onCancel
|
|
19
|
-
})
|
|
20
|
-
}, jsx(InlineCreate, props)));
|
|
14
|
+
return jsx(Experience, null, jsx(ErrorBoundary, null, jsx(InlineCreate, props)));
|
|
21
15
|
}));
|
|
22
16
|
const ComposedLinkCreate = /*#__PURE__*/memo(props => {
|
|
23
17
|
return jsx(AnalyticsContext, {
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { AnalyticsContext } from '@atlaskit/analytics-next';
|
|
3
|
+
import { ScreenViewedEvent } from '../../..//common/utils/analytics/components';
|
|
4
|
+
export const InlineAnalytics = ({
|
|
5
|
+
screen,
|
|
6
|
+
children
|
|
7
|
+
}) => /*#__PURE__*/React.createElement(AnalyticsContext, {
|
|
8
|
+
data: {
|
|
9
|
+
source: screen,
|
|
10
|
+
component: 'inline-create'
|
|
11
|
+
}
|
|
12
|
+
}, /*#__PURE__*/React.createElement(ScreenViewedEvent, {
|
|
13
|
+
screen: screen
|
|
14
|
+
}), children);
|
|
@@ -3,21 +3,17 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
3
3
|
import { useCallback, useState } from 'react';
|
|
4
4
|
import { jsx } from '@emotion/react';
|
|
5
5
|
import { Box } from '@atlaskit/primitives';
|
|
6
|
+
import { DEFAULT_TEST_ID, SCREEN_ID } from '../../common/constants';
|
|
6
7
|
import { ConfirmDismissDialog } from '../../common/ui/confirm-dismiss-dialog';
|
|
7
8
|
import { EditModal } from '../../common/ui/edit-modal';
|
|
8
9
|
import { ErrorBoundary } from '../../common/ui/error-boundary';
|
|
9
10
|
import { LinkCreateContent } from '../../common/ui/link-create-content';
|
|
10
|
-
import { LinkCreateCallbackProvider
|
|
11
|
-
// useLinkCreateCallback,
|
|
12
|
-
} from '../../controllers/callback-context';
|
|
11
|
+
import { LinkCreateCallbackProvider } from '../../controllers/callback-context';
|
|
13
12
|
import { EditPostCreateModalProvider, useEditPostCreateModal } from '../../controllers/edit-post-create-context';
|
|
14
13
|
import { ExitWarningModalProvider, useExitWarningModal } from '../../controllers/exit-warning-modal-context';
|
|
15
14
|
import { FormContextProvider } from '../../controllers/form-context';
|
|
16
15
|
import { LinkCreatePluginsProvider, useLinkCreatePlugins } from '../../controllers/plugin-context';
|
|
17
|
-
|
|
18
|
-
// todo: EDM-10075 trigger the screen.viewed_linkCreateScreen event when inline-create is mounted
|
|
19
|
-
// const SCREEN_ID = 'linkCreateScreen';
|
|
20
|
-
|
|
16
|
+
import { InlineAnalytics } from './inline-analytics';
|
|
21
17
|
const InlineCreateContent = ({
|
|
22
18
|
onCreate,
|
|
23
19
|
onFailure,
|
|
@@ -25,7 +21,7 @@ const InlineCreateContent = ({
|
|
|
25
21
|
onComplete,
|
|
26
22
|
plugins,
|
|
27
23
|
entityKey,
|
|
28
|
-
testId
|
|
24
|
+
testId = DEFAULT_TEST_ID
|
|
29
25
|
}) => {
|
|
30
26
|
const {
|
|
31
27
|
getShouldShowWarning
|
|
@@ -49,12 +45,14 @@ const InlineCreateContent = ({
|
|
|
49
45
|
onCreate: onCreate,
|
|
50
46
|
onFailure: onFailure,
|
|
51
47
|
onCancel: handleCancel
|
|
52
|
-
}, jsx(ErrorBoundary, null, jsx(
|
|
48
|
+
}, jsx(ErrorBoundary, null, jsx(InlineAnalytics, {
|
|
49
|
+
screen: SCREEN_ID
|
|
50
|
+
}, jsx(Box, {
|
|
53
51
|
testId: testId
|
|
54
52
|
}, jsx(LinkCreateContent, {
|
|
55
53
|
plugins: plugins,
|
|
56
54
|
entityKey: entityKey
|
|
57
|
-
}))), onComplete && jsx(EditModal, {
|
|
55
|
+
})))), onComplete && jsx(EditModal, {
|
|
58
56
|
onClose: onComplete,
|
|
59
57
|
editViewPayload: editViewPayload,
|
|
60
58
|
activePlugin: activePlugin
|
|
@@ -5,7 +5,7 @@ import { jsx } from '@emotion/react';
|
|
|
5
5
|
import { useIntl } from 'react-intl-next';
|
|
6
6
|
import { ModalBody, ModalHeader, ModalTitle, ModalTransition } from '@atlaskit/modal-dialog';
|
|
7
7
|
import { Box } from '@atlaskit/primitives';
|
|
8
|
-
import { CREATE_FORM_MAX_WIDTH_IN_PX } from '../../common/constants';
|
|
8
|
+
import { CREATE_FORM_MAX_WIDTH_IN_PX, DEFAULT_TEST_ID, SCREEN_ID } from '../../common/constants';
|
|
9
9
|
import { ConfirmDismissDialog } from '../../common/ui/confirm-dismiss-dialog';
|
|
10
10
|
import { EditModal } from '../../common/ui/edit-modal';
|
|
11
11
|
import { ErrorBoundary } from '../../common/ui/error-boundary';
|
|
@@ -18,8 +18,6 @@ import { ExitWarningModalProvider, useExitWarningModal } from '../../controllers
|
|
|
18
18
|
import { FormContextProvider } from '../../controllers/form-context';
|
|
19
19
|
import { LinkCreatePluginsProvider, useLinkCreatePlugins } from '../../controllers/plugin-context';
|
|
20
20
|
import { messages } from './messages';
|
|
21
|
-
export const TEST_ID = 'link-create';
|
|
22
|
-
const SCREEN_ID = 'linkCreateScreen';
|
|
23
21
|
const LinkCreateWithModal = ({
|
|
24
22
|
active,
|
|
25
23
|
modalTitle,
|
|
@@ -29,7 +27,7 @@ const LinkCreateWithModal = ({
|
|
|
29
27
|
onComplete,
|
|
30
28
|
onOpenComplete,
|
|
31
29
|
onCloseComplete,
|
|
32
|
-
testId =
|
|
30
|
+
testId = DEFAULT_TEST_ID,
|
|
33
31
|
plugins,
|
|
34
32
|
entityKey,
|
|
35
33
|
modalHero
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
export var ANALYTICS_CHANNEL = 'media';
|
|
2
2
|
export var COMPONENT_NAME = 'linkCreate';
|
|
3
|
+
export var SCREEN_ID = 'linkCreateScreen';
|
|
4
|
+
export var DEFAULT_TEST_ID = 'link-create';
|
|
3
5
|
export var CREATE_FORM_MAX_WIDTH_IN_PX = '480';
|
|
4
6
|
export var CREATE_FORM_MIN_HEIGHT_IN_PX = '200';
|
|
5
7
|
export var LINK_CREATE_FORM_POST_CREATE_FIELD = '__post_create__';
|
|
6
8
|
export var PACKAGE_DATA = {
|
|
7
9
|
packageName: "@atlaskit/link-create" || '',
|
|
8
|
-
packageVersion: "2.
|
|
10
|
+
packageVersion: "2.4.0" || '',
|
|
9
11
|
component: COMPONENT_NAME,
|
|
10
12
|
componentName: COMPONENT_NAME
|
|
11
13
|
};
|
|
@@ -6,7 +6,7 @@ import SmartUserPicker from '@atlaskit/smart-user-picker';
|
|
|
6
6
|
import { CreateField } from '../../../controllers/create-field';
|
|
7
7
|
export var TEST_ID = 'link-create-user-picker';
|
|
8
8
|
var DEFAULT_DEBOUNCE_TIME = 400;
|
|
9
|
-
var UserPickerWidth =
|
|
9
|
+
var UserPickerWidth = '100%';
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
12
|
* A user picker utilising the SmartUserPicker.
|
|
@@ -5,19 +5,13 @@ import { AnalyticsContext } from '@atlaskit/analytics-next';
|
|
|
5
5
|
import { IntlMessagesProvider } from '@atlaskit/intl-messages-provider';
|
|
6
6
|
import { PACKAGE_DATA } from '../../common/constants';
|
|
7
7
|
import { ErrorBoundary } from '../../common/ui/error-boundary';
|
|
8
|
-
import { ErrorBoundaryModal } from '../../common/ui/error-boundary-modal';
|
|
9
8
|
import { Experience } from '../../common/ui/experience-tracker';
|
|
10
9
|
import { withLinkCreateAnalyticsContext } from '../../common/utils/analytics';
|
|
11
10
|
import { fetchMessagesForLocale } from '../../common/utils/locale/fetch-messages-for-locale';
|
|
12
11
|
import i18nEN from '../../i18n/en';
|
|
13
12
|
import InlineCreate from './main';
|
|
14
13
|
var LinkCreateWithAnalyticsContext = withLinkCreateAnalyticsContext( /*#__PURE__*/memo(function (props) {
|
|
15
|
-
return jsx(Experience, null, jsx(ErrorBoundary,
|
|
16
|
-
errorComponent: jsx(ErrorBoundaryModal, {
|
|
17
|
-
active: props.active,
|
|
18
|
-
onClose: props.onCancel
|
|
19
|
-
})
|
|
20
|
-
}, jsx(InlineCreate, props)));
|
|
14
|
+
return jsx(Experience, null, jsx(ErrorBoundary, null, jsx(InlineCreate, props)));
|
|
21
15
|
}));
|
|
22
16
|
var ComposedLinkCreate = /*#__PURE__*/memo(function (props) {
|
|
23
17
|
return jsx(AnalyticsContext, {
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { AnalyticsContext } from '@atlaskit/analytics-next';
|
|
3
|
+
import { ScreenViewedEvent } from '../../..//common/utils/analytics/components';
|
|
4
|
+
export var InlineAnalytics = function InlineAnalytics(_ref) {
|
|
5
|
+
var screen = _ref.screen,
|
|
6
|
+
children = _ref.children;
|
|
7
|
+
return /*#__PURE__*/React.createElement(AnalyticsContext, {
|
|
8
|
+
data: {
|
|
9
|
+
source: screen,
|
|
10
|
+
component: 'inline-create'
|
|
11
|
+
}
|
|
12
|
+
}, /*#__PURE__*/React.createElement(ScreenViewedEvent, {
|
|
13
|
+
screen: screen
|
|
14
|
+
}), children);
|
|
15
|
+
};
|
|
@@ -6,21 +6,17 @@ import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
|
6
6
|
import { useCallback, useState } from 'react';
|
|
7
7
|
import { jsx } from '@emotion/react';
|
|
8
8
|
import { Box } from '@atlaskit/primitives';
|
|
9
|
+
import { DEFAULT_TEST_ID, SCREEN_ID } from '../../common/constants';
|
|
9
10
|
import { ConfirmDismissDialog } from '../../common/ui/confirm-dismiss-dialog';
|
|
10
11
|
import { EditModal } from '../../common/ui/edit-modal';
|
|
11
12
|
import { ErrorBoundary } from '../../common/ui/error-boundary';
|
|
12
13
|
import { LinkCreateContent } from '../../common/ui/link-create-content';
|
|
13
|
-
import { LinkCreateCallbackProvider
|
|
14
|
-
// useLinkCreateCallback,
|
|
15
|
-
} from '../../controllers/callback-context';
|
|
14
|
+
import { LinkCreateCallbackProvider } from '../../controllers/callback-context';
|
|
16
15
|
import { EditPostCreateModalProvider, useEditPostCreateModal } from '../../controllers/edit-post-create-context';
|
|
17
16
|
import { ExitWarningModalProvider, useExitWarningModal } from '../../controllers/exit-warning-modal-context';
|
|
18
17
|
import { FormContextProvider } from '../../controllers/form-context';
|
|
19
18
|
import { LinkCreatePluginsProvider, useLinkCreatePlugins } from '../../controllers/plugin-context';
|
|
20
|
-
|
|
21
|
-
// todo: EDM-10075 trigger the screen.viewed_linkCreateScreen event when inline-create is mounted
|
|
22
|
-
// const SCREEN_ID = 'linkCreateScreen';
|
|
23
|
-
|
|
19
|
+
import { InlineAnalytics } from './inline-analytics';
|
|
24
20
|
var InlineCreateContent = function InlineCreateContent(_ref) {
|
|
25
21
|
var onCreate = _ref.onCreate,
|
|
26
22
|
onFailure = _ref.onFailure,
|
|
@@ -28,7 +24,8 @@ var InlineCreateContent = function InlineCreateContent(_ref) {
|
|
|
28
24
|
onComplete = _ref.onComplete,
|
|
29
25
|
plugins = _ref.plugins,
|
|
30
26
|
entityKey = _ref.entityKey,
|
|
31
|
-
testId = _ref.testId
|
|
27
|
+
_ref$testId = _ref.testId,
|
|
28
|
+
testId = _ref$testId === void 0 ? DEFAULT_TEST_ID : _ref$testId;
|
|
32
29
|
var _useExitWarningModal = useExitWarningModal(),
|
|
33
30
|
getShouldShowWarning = _useExitWarningModal.getShouldShowWarning;
|
|
34
31
|
var _useState = useState(false),
|
|
@@ -53,12 +50,14 @@ var InlineCreateContent = function InlineCreateContent(_ref) {
|
|
|
53
50
|
onCreate: onCreate,
|
|
54
51
|
onFailure: onFailure,
|
|
55
52
|
onCancel: handleCancel
|
|
56
|
-
}, jsx(ErrorBoundary, null, jsx(
|
|
53
|
+
}, jsx(ErrorBoundary, null, jsx(InlineAnalytics, {
|
|
54
|
+
screen: SCREEN_ID
|
|
55
|
+
}, jsx(Box, {
|
|
57
56
|
testId: testId
|
|
58
57
|
}, jsx(LinkCreateContent, {
|
|
59
58
|
plugins: plugins,
|
|
60
59
|
entityKey: entityKey
|
|
61
|
-
}))), onComplete && jsx(EditModal, {
|
|
60
|
+
})))), onComplete && jsx(EditModal, {
|
|
62
61
|
onClose: onComplete,
|
|
63
62
|
editViewPayload: editViewPayload,
|
|
64
63
|
activePlugin: activePlugin
|
|
@@ -8,7 +8,7 @@ import { jsx } from '@emotion/react';
|
|
|
8
8
|
import { useIntl } from 'react-intl-next';
|
|
9
9
|
import { ModalBody, ModalHeader, ModalTitle, ModalTransition } from '@atlaskit/modal-dialog';
|
|
10
10
|
import { Box } from '@atlaskit/primitives';
|
|
11
|
-
import { CREATE_FORM_MAX_WIDTH_IN_PX } from '../../common/constants';
|
|
11
|
+
import { CREATE_FORM_MAX_WIDTH_IN_PX, DEFAULT_TEST_ID, SCREEN_ID } from '../../common/constants';
|
|
12
12
|
import { ConfirmDismissDialog } from '../../common/ui/confirm-dismiss-dialog';
|
|
13
13
|
import { EditModal } from '../../common/ui/edit-modal';
|
|
14
14
|
import { ErrorBoundary } from '../../common/ui/error-boundary';
|
|
@@ -21,8 +21,6 @@ import { ExitWarningModalProvider, useExitWarningModal } from '../../controllers
|
|
|
21
21
|
import { FormContextProvider } from '../../controllers/form-context';
|
|
22
22
|
import { LinkCreatePluginsProvider, useLinkCreatePlugins } from '../../controllers/plugin-context';
|
|
23
23
|
import { messages } from './messages';
|
|
24
|
-
export var TEST_ID = 'link-create';
|
|
25
|
-
var SCREEN_ID = 'linkCreateScreen';
|
|
26
24
|
var LinkCreateWithModal = function LinkCreateWithModal(_ref) {
|
|
27
25
|
var active = _ref.active,
|
|
28
26
|
modalTitle = _ref.modalTitle,
|
|
@@ -33,7 +31,7 @@ var LinkCreateWithModal = function LinkCreateWithModal(_ref) {
|
|
|
33
31
|
onOpenComplete = _ref.onOpenComplete,
|
|
34
32
|
onCloseComplete = _ref.onCloseComplete,
|
|
35
33
|
_ref$testId = _ref.testId,
|
|
36
|
-
testId = _ref$testId === void 0 ?
|
|
34
|
+
testId = _ref$testId === void 0 ? DEFAULT_TEST_ID : _ref$testId,
|
|
37
35
|
plugins = _ref.plugins,
|
|
38
36
|
entityKey = _ref.entityKey,
|
|
39
37
|
modalHero = _ref.modalHero;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import type { PackageMetaDataType } from './utils/analytics/analytics.codegen';
|
|
2
2
|
export declare const ANALYTICS_CHANNEL = "media";
|
|
3
3
|
export declare const COMPONENT_NAME = "linkCreate";
|
|
4
|
+
export declare const SCREEN_ID = "linkCreateScreen";
|
|
5
|
+
export declare const DEFAULT_TEST_ID = "link-create";
|
|
4
6
|
export declare const CREATE_FORM_MAX_WIDTH_IN_PX = "480";
|
|
5
7
|
export declare const CREATE_FORM_MIN_HEIGHT_IN_PX = "200";
|
|
6
8
|
export declare const LINK_CREATE_FORM_POST_CREATE_FIELD = "__post_create__";
|
|
@@ -7,5 +7,5 @@ type ErrorBoundaryModalProps = {
|
|
|
7
7
|
active?: boolean;
|
|
8
8
|
onClose?: () => void;
|
|
9
9
|
};
|
|
10
|
-
export declare const ErrorBoundaryModal:
|
|
10
|
+
export declare const ErrorBoundaryModal: ({ active, onClose }: ErrorBoundaryModalProps) => JSX.Element;
|
|
11
11
|
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type PropsWithChildren } from 'react';
|
|
2
|
+
import type { AnalyticsEventAttributes } from '../../../common/utils/analytics/analytics.codegen';
|
|
3
|
+
type InlineAnalyticsProps = {
|
|
4
|
+
screen: keyof {
|
|
5
|
+
[Key in keyof AnalyticsEventAttributes as Key extends `screen.${infer ScreenName}.viewed` ? ScreenName : never]: any;
|
|
6
|
+
};
|
|
7
|
+
};
|
|
8
|
+
export declare const InlineAnalytics: ({ screen, children }: PropsWithChildren<InlineAnalyticsProps>) => JSX.Element;
|
|
9
|
+
export {};
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { jsx } from '@emotion/react';
|
|
2
2
|
import type { LinkCreateWithModalProps } from '../../common/types';
|
|
3
|
-
export declare const TEST_ID = "link-create";
|
|
4
3
|
declare const LinkCreateModal: (props: LinkCreateWithModalProps) => jsx.JSX.Element;
|
|
5
4
|
export default LinkCreateModal;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import type { PackageMetaDataType } from './utils/analytics/analytics.codegen';
|
|
2
2
|
export declare const ANALYTICS_CHANNEL = "media";
|
|
3
3
|
export declare const COMPONENT_NAME = "linkCreate";
|
|
4
|
+
export declare const SCREEN_ID = "linkCreateScreen";
|
|
5
|
+
export declare const DEFAULT_TEST_ID = "link-create";
|
|
4
6
|
export declare const CREATE_FORM_MAX_WIDTH_IN_PX = "480";
|
|
5
7
|
export declare const CREATE_FORM_MIN_HEIGHT_IN_PX = "200";
|
|
6
8
|
export declare const LINK_CREATE_FORM_POST_CREATE_FIELD = "__post_create__";
|
|
@@ -7,5 +7,5 @@ type ErrorBoundaryModalProps = {
|
|
|
7
7
|
active?: boolean;
|
|
8
8
|
onClose?: () => void;
|
|
9
9
|
};
|
|
10
|
-
export declare const ErrorBoundaryModal:
|
|
10
|
+
export declare const ErrorBoundaryModal: ({ active, onClose }: ErrorBoundaryModalProps) => JSX.Element;
|
|
11
11
|
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type PropsWithChildren } from 'react';
|
|
2
|
+
import type { AnalyticsEventAttributes } from '../../../common/utils/analytics/analytics.codegen';
|
|
3
|
+
type InlineAnalyticsProps = {
|
|
4
|
+
screen: keyof {
|
|
5
|
+
[Key in keyof AnalyticsEventAttributes as Key extends `screen.${infer ScreenName}.viewed` ? ScreenName : never]: any;
|
|
6
|
+
};
|
|
7
|
+
};
|
|
8
|
+
export declare const InlineAnalytics: ({ screen, children }: PropsWithChildren<InlineAnalyticsProps>) => JSX.Element;
|
|
9
|
+
export {};
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { jsx } from '@emotion/react';
|
|
2
2
|
import type { LinkCreateWithModalProps } from '../../common/types';
|
|
3
|
-
export declare const TEST_ID = "link-create";
|
|
4
3
|
declare const LinkCreateModal: (props: LinkCreateWithModalProps) => jsx.JSX.Element;
|
|
5
4
|
export default LinkCreateModal;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/link-create",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.4.0",
|
|
4
4
|
"description": "The driver component of meta creation flow",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"@atlaskit/intl-messages-provider": "^1.0.2",
|
|
47
47
|
"@atlaskit/linking-common": "^5.7.0",
|
|
48
48
|
"@atlaskit/modal-dialog": "^12.13.0",
|
|
49
|
-
"@atlaskit/primitives": "^
|
|
49
|
+
"@atlaskit/primitives": "^7.0.0",
|
|
50
50
|
"@atlaskit/select": "^17.10.0",
|
|
51
51
|
"@atlaskit/smart-user-picker": "^6.9.0",
|
|
52
52
|
"@atlaskit/spinner": "^16.1.0",
|
package/report.api.md
CHANGED
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
## API Report File for "@atlaskit/link-create"
|
|
4
4
|
|
|
5
|
-
> Do not edit this file. This report is auto-generated using
|
|
5
|
+
> Do not edit this file. This report is auto-generated using
|
|
6
|
+
> [API Extractor](https://api-extractor.com/).
|
|
6
7
|
> [Learn more about API reports](https://hello.atlassian.net/wiki/spaces/UR/pages/1825484529/Package+API+Reports)
|
|
7
8
|
|
|
8
9
|
### Table of contents
|
|
@@ -32,85 +33,76 @@ import { TextFieldProps as TextFieldProps_2 } from '@atlaskit/textfield';
|
|
|
32
33
|
|
|
33
34
|
// @public
|
|
34
35
|
export function AsyncSelect<T = OptionType>({
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
36
|
+
id,
|
|
37
|
+
name,
|
|
38
|
+
label,
|
|
39
|
+
isRequired,
|
|
40
|
+
validators,
|
|
41
|
+
validationHelpText,
|
|
42
|
+
testId,
|
|
43
|
+
defaultOption: propsDefaultValue,
|
|
44
|
+
loadOptions: loadOptionsFn,
|
|
45
|
+
...restProps
|
|
45
46
|
}: AsyncSelectProps<T>): jsx.JSX.Element;
|
|
46
47
|
|
|
47
48
|
// @public (undocumented)
|
|
48
|
-
type AsyncSelectProps<T = OptionType> = Omit<
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
isRequired?: boolean;
|
|
57
|
-
validators?: Validator[];
|
|
58
|
-
loadOptions?: (inputValue: string) => Promise<GroupType<T>[] | T[]>;
|
|
49
|
+
type AsyncSelectProps<T = OptionType> = Omit<AsyncSelectProps_2<T>, 'loadOptions'> & {
|
|
50
|
+
name: string;
|
|
51
|
+
label: string;
|
|
52
|
+
validationHelpText?: string;
|
|
53
|
+
testId?: string;
|
|
54
|
+
isRequired?: boolean;
|
|
55
|
+
validators?: Validator[];
|
|
56
|
+
loadOptions?: (inputValue: string) => Promise<GroupType<T>[] | T[]>;
|
|
59
57
|
};
|
|
60
58
|
|
|
61
59
|
// @public (undocumented)
|
|
62
|
-
const ComposedLinkCreate: MemoExoticComponent<
|
|
63
|
-
(props: LinkCreateWithModalProps) => jsx.JSX.Element
|
|
64
|
-
>;
|
|
60
|
+
const ComposedLinkCreate: MemoExoticComponent<(props: LinkCreateWithModalProps) => jsx.JSX.Element>;
|
|
65
61
|
export default ComposedLinkCreate;
|
|
66
62
|
|
|
67
63
|
// @public (undocumented)
|
|
68
64
|
export const CreateForm: <FormData_1 extends Record<string, any> = {}>({
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
65
|
+
children,
|
|
66
|
+
testId,
|
|
67
|
+
onSubmit,
|
|
68
|
+
onCancel,
|
|
69
|
+
isLoading,
|
|
70
|
+
hideFooter,
|
|
71
|
+
initialValues,
|
|
76
72
|
}: CreateFormProps<FormData_1>) => jsx.JSX.Element;
|
|
77
73
|
|
|
78
74
|
// @public
|
|
79
|
-
export function CreateFormLoader({
|
|
80
|
-
size,
|
|
81
|
-
}: Partial<SpinnerProps>): jsx.JSX.Element;
|
|
75
|
+
export function CreateFormLoader({ size }: Partial<SpinnerProps>): jsx.JSX.Element;
|
|
82
76
|
|
|
83
77
|
// @public (undocumented)
|
|
84
78
|
export interface CreateFormProps<FormData> {
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
) => Errors | Promise<Errors | void> | void;
|
|
93
|
-
testId?: string;
|
|
79
|
+
children: ReactNode;
|
|
80
|
+
hideFooter?: boolean;
|
|
81
|
+
initialValues?: DisallowReservedFields<FormData>;
|
|
82
|
+
isLoading?: boolean;
|
|
83
|
+
onCancel?: () => void;
|
|
84
|
+
onSubmit: (data: OmitReservedFields<FormData>) => Errors | Promise<Errors | void> | void;
|
|
85
|
+
testId?: string;
|
|
94
86
|
}
|
|
95
87
|
|
|
96
88
|
// @public
|
|
97
89
|
export type CreatePayload = {
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
90
|
+
url: string;
|
|
91
|
+
ari?: string | undefined;
|
|
92
|
+
objectId: string;
|
|
93
|
+
objectType: string;
|
|
94
|
+
data?: Record<string, unknown>;
|
|
103
95
|
};
|
|
104
96
|
|
|
105
97
|
// @public (undocumented)
|
|
106
98
|
type DisallowReservedFields<T> = T & {
|
|
107
|
-
|
|
99
|
+
[Field in (typeof RESERVED_FIELDS)[number]]?: never;
|
|
108
100
|
};
|
|
109
101
|
|
|
110
102
|
// @public (undocumented)
|
|
111
103
|
export type EditViewProps = {
|
|
112
|
-
|
|
113
|
-
|
|
104
|
+
payload: CreatePayload;
|
|
105
|
+
onClose: () => void;
|
|
114
106
|
};
|
|
115
107
|
|
|
116
108
|
// @public (undocumented)
|
|
@@ -120,19 +112,19 @@ export { FORM_ERROR };
|
|
|
120
112
|
|
|
121
113
|
// @public
|
|
122
114
|
export const FormSpy: <T extends Record<string, unknown>>({
|
|
123
|
-
|
|
115
|
+
children,
|
|
124
116
|
}: FormSpyProps<T>) => JSX.Element;
|
|
125
117
|
|
|
126
118
|
// @public (undocumented)
|
|
127
119
|
type FormSpyProps<T> = {
|
|
128
|
-
|
|
120
|
+
children: ({ values }: { values: T }) => React_2.ReactNode;
|
|
129
121
|
};
|
|
130
122
|
|
|
131
123
|
// @public (undocumented)
|
|
132
124
|
interface Group {
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
125
|
+
icon: string;
|
|
126
|
+
key: string;
|
|
127
|
+
label: string;
|
|
136
128
|
}
|
|
137
129
|
|
|
138
130
|
// @public (undocumented)
|
|
@@ -140,41 +132,41 @@ export const LinkCreateCallbackProvider: React_2.FC<LinkCreateCallbackProviderPr
|
|
|
140
132
|
|
|
141
133
|
// @public (undocumented)
|
|
142
134
|
interface LinkCreateCallbackProviderProps {
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
135
|
+
onCancel?: () => void;
|
|
136
|
+
onCreate?: (result: CreatePayload) => Promise<void> | void;
|
|
137
|
+
onFailure?: (error: unknown) => void;
|
|
146
138
|
}
|
|
147
139
|
|
|
148
140
|
// @public (undocumented)
|
|
149
141
|
export interface LinkCreatePlugin {
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
142
|
+
editView?: ({ payload, onClose }: EditViewProps) => JSX.Element;
|
|
143
|
+
form: ReactNode;
|
|
144
|
+
group: Group;
|
|
145
|
+
icon: string;
|
|
146
|
+
key: string;
|
|
147
|
+
label: string;
|
|
156
148
|
}
|
|
157
149
|
|
|
158
150
|
// @public (undocumented)
|
|
159
151
|
export interface LinkCreateProps {
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
152
|
+
entityKey: string;
|
|
153
|
+
groupKey?: string;
|
|
154
|
+
onCancel?: () => void;
|
|
155
|
+
onComplete?: () => void;
|
|
156
|
+
onCreate?: (payload: CreatePayload) => Promise<void> | void;
|
|
157
|
+
onFailure?: (error: unknown) => void;
|
|
158
|
+
// (undocumented)
|
|
159
|
+
plugins: LinkCreatePlugin[];
|
|
160
|
+
testId?: string;
|
|
161
|
+
triggeredFrom?: string;
|
|
170
162
|
}
|
|
171
163
|
|
|
172
164
|
// @public (undocumented)
|
|
173
165
|
export interface LinkCreateWithModalProps
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
166
|
+
extends LinkCreateProps,
|
|
167
|
+
Partial<Pick<ModalDialogProps, 'onCloseComplete' | 'onOpenComplete'>> {
|
|
168
|
+
active?: boolean;
|
|
169
|
+
modalTitle?: string;
|
|
178
170
|
}
|
|
179
171
|
|
|
180
172
|
// @public (undocumented)
|
|
@@ -185,49 +177,49 @@ const RESERVED_FIELDS: readonly ['__post_create__'];
|
|
|
185
177
|
|
|
186
178
|
// @public (undocumented)
|
|
187
179
|
type ReservedFields = {
|
|
188
|
-
|
|
180
|
+
[Field in (typeof RESERVED_FIELDS)[number]]?: unknown;
|
|
189
181
|
};
|
|
190
182
|
|
|
191
183
|
// @public
|
|
192
184
|
export function Select<T = OptionType>({
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
185
|
+
id,
|
|
186
|
+
name,
|
|
187
|
+
label,
|
|
188
|
+
isRequired,
|
|
189
|
+
validators,
|
|
190
|
+
validationHelpText,
|
|
191
|
+
testId,
|
|
192
|
+
...restProps
|
|
201
193
|
}: SelectProps<T>): jsx.JSX.Element;
|
|
202
194
|
|
|
203
195
|
// @public (undocumented)
|
|
204
196
|
type SelectProps<T = OptionType> = SelectProps_2<T> & {
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
197
|
+
name: string;
|
|
198
|
+
label: string;
|
|
199
|
+
validationHelpText?: string;
|
|
200
|
+
testId?: string;
|
|
201
|
+
isRequired?: boolean;
|
|
202
|
+
validators?: Validator[];
|
|
211
203
|
};
|
|
212
204
|
|
|
213
205
|
// @public
|
|
214
206
|
export function TextField({
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
207
|
+
id,
|
|
208
|
+
name,
|
|
209
|
+
label,
|
|
210
|
+
isRequired,
|
|
211
|
+
validators,
|
|
212
|
+
validationHelpText,
|
|
213
|
+
testId,
|
|
214
|
+
...restProps
|
|
223
215
|
}: TextFieldProps): jsx.JSX.Element;
|
|
224
216
|
|
|
225
217
|
// @public (undocumented)
|
|
226
218
|
type TextFieldProps = Omit<TextFieldProps_2, 'name'> & {
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
219
|
+
name: string;
|
|
220
|
+
label?: string;
|
|
221
|
+
validationHelpText?: string;
|
|
222
|
+
validators?: Validator[];
|
|
231
223
|
};
|
|
232
224
|
|
|
233
225
|
// @public (undocumented)
|
|
@@ -235,8 +227,8 @@ export const useLinkCreateCallback: () => LinkCreateCallbackProviderProps;
|
|
|
235
227
|
|
|
236
228
|
// @public (undocumented)
|
|
237
229
|
export type Validator = {
|
|
238
|
-
|
|
239
|
-
|
|
230
|
+
isValid: (val: unknown) => boolean;
|
|
231
|
+
errorMessage: string;
|
|
240
232
|
};
|
|
241
233
|
|
|
242
234
|
// @public
|
|
@@ -253,8 +245,8 @@ export type ValidatorMap = Record<string, Validator[]>;
|
|
|
253
245
|
|
|
254
246
|
```json
|
|
255
247
|
{
|
|
256
|
-
|
|
257
|
-
|
|
248
|
+
"react": "^16.8.0",
|
|
249
|
+
"react-intl-next": "npm:react-intl@^5.18.1"
|
|
258
250
|
}
|
|
259
251
|
```
|
|
260
252
|
|