@atlaskit/link-create 6.3.5 → 6.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 +27 -0
- package/analytics.spec.yaml +19 -0
- package/dist/cjs/common/constants.js +1 -1
- package/dist/cjs/common/utils/analytics/analytics.codegen.js +1 -1
- package/dist/cjs/controllers/callback-context/main.js +18 -4
- package/dist/cjs/ui/create-form/form-footer/edit-button/index.js +0 -2
- package/dist/cjs/ui/create-form/form-footer/submit-button/index.js +0 -4
- package/dist/es2019/common/constants.js +1 -1
- package/dist/es2019/common/utils/analytics/analytics.codegen.js +1 -1
- package/dist/es2019/controllers/callback-context/main.js +21 -3
- package/dist/es2019/ui/create-form/async-select/main.js +0 -1
- package/dist/es2019/ui/create-form/form-footer/edit-button/index.js +0 -1
- package/dist/es2019/ui/create-form/form-footer/submit-button/index.js +0 -2
- package/dist/esm/common/constants.js +1 -1
- package/dist/esm/common/utils/analytics/analytics.codegen.js +1 -1
- package/dist/esm/controllers/callback-context/main.js +20 -5
- package/dist/esm/ui/create-form/form-footer/edit-button/index.js +0 -1
- package/dist/esm/ui/create-form/form-footer/submit-button/index.js +0 -2
- package/dist/types/common/types.d.ts +12 -0
- package/dist/types/common/utils/analytics/analytics.codegen.d.ts +4 -1
- package/dist/types/controllers/callback-context/main.d.ts +10 -2
- package/package.json +13 -9
- package/link-create.docs.tsx +0 -351
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,32 @@
|
|
|
1
1
|
# @atlaskit/link-create
|
|
2
2
|
|
|
3
|
+
## 6.4.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`db8537fc93efc`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/db8537fc93efc) -
|
|
8
|
+
Adds diagnostic fields to the `object createFailed (linkCreate)` analytics event so that failures
|
|
9
|
+
can be attributed to the specific operation that failed. `onFailure` now accepts an optional
|
|
10
|
+
second argument describing the failed operation.
|
|
11
|
+
|
|
12
|
+
Behind the `platform_link_create_event_tracking` feature gate the event additionally records:
|
|
13
|
+
- `operation` — a controlled value identifying the failed operation (for example `fetch-space`,
|
|
14
|
+
`fetch-page`, `create-page`)
|
|
15
|
+
- `status` — the HTTP status code, when the failure was an HTTP response
|
|
16
|
+
- `traceId` — the request trace ID, when available
|
|
17
|
+
|
|
18
|
+
No URLs, paths or user-generated content are recorded.
|
|
19
|
+
|
|
20
|
+
### Patch Changes
|
|
21
|
+
|
|
22
|
+
- Updated dependencies
|
|
23
|
+
|
|
24
|
+
## 6.3.6
|
|
25
|
+
|
|
26
|
+
### Patch Changes
|
|
27
|
+
|
|
28
|
+
- Updated dependencies
|
|
29
|
+
|
|
3
30
|
## 6.3.5
|
|
4
31
|
|
|
5
32
|
### Patch Changes
|
package/analytics.spec.yaml
CHANGED
|
@@ -130,6 +130,25 @@ events:
|
|
|
130
130
|
failureType:
|
|
131
131
|
type: string
|
|
132
132
|
description: the name of the failure
|
|
133
|
+
operation:
|
|
134
|
+
type: string
|
|
135
|
+
required: false
|
|
136
|
+
description:
|
|
137
|
+
which operation failed, as a controlled value such as `fetch-space`, `fetch-page`,
|
|
138
|
+
`create-page` or `submit-form`. Never contains user-generated content, URLs or tenant
|
|
139
|
+
identifiers. Absent when the failing operation could not be attributed
|
|
140
|
+
status:
|
|
141
|
+
type: number
|
|
142
|
+
required: false
|
|
143
|
+
description:
|
|
144
|
+
the HTTP status code, when the failure originated from a non-OK network response.
|
|
145
|
+
Absent otherwise
|
|
146
|
+
traceId:
|
|
147
|
+
type: string
|
|
148
|
+
required: false
|
|
149
|
+
description:
|
|
150
|
+
the trace id of the failed request, used to correlate with server-side logs. Absent
|
|
151
|
+
when the failure did not originate from a network response
|
|
133
152
|
|
|
134
153
|
- linkCreateExperience failed:
|
|
135
154
|
type: operational
|
|
@@ -16,7 +16,7 @@ var CREATE_FORM_MIN_HEIGHT_IN_PX = exports.CREATE_FORM_MIN_HEIGHT_IN_PX = '200';
|
|
|
16
16
|
var LINK_CREATE_FORM_POST_CREATE_FIELD = exports.LINK_CREATE_FORM_POST_CREATE_FIELD = '__post_create__';
|
|
17
17
|
var PACKAGE_DATA = exports.PACKAGE_DATA = {
|
|
18
18
|
packageName: "@atlaskit/link-create" || '',
|
|
19
|
-
packageVersion: "6.3.
|
|
19
|
+
packageVersion: "6.3.6" || '',
|
|
20
20
|
component: COMPONENT_NAME,
|
|
21
21
|
componentName: COMPONENT_NAME
|
|
22
22
|
};
|
|
@@ -11,7 +11,7 @@ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/sli
|
|
|
11
11
|
*
|
|
12
12
|
* Generates Typescript types for analytics events from analytics.spec.yaml
|
|
13
13
|
*
|
|
14
|
-
* @codegen <<SignedSource::
|
|
14
|
+
* @codegen <<SignedSource::ab46b9594ace5e515376a9aa203f040c>>
|
|
15
15
|
* @codegenCommand yarn workspace @atlaskit/link-create run codegen-analytics
|
|
16
16
|
*/
|
|
17
17
|
|
|
@@ -11,6 +11,7 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
|
|
|
11
11
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
12
12
|
var _react = _interopRequireWildcard(require("react"));
|
|
13
13
|
var _analyticsNext = require("@atlaskit/analytics-next");
|
|
14
|
+
var _fg = require("@atlaskit/platform-feature-flags/fg");
|
|
14
15
|
var _constants = require("../../common/constants");
|
|
15
16
|
var _experienceTracker = require("../../common/ui/experience-tracker");
|
|
16
17
|
var _analytics = _interopRequireDefault(require("../../common/utils/analytics/analytics.codegen"));
|
|
@@ -18,6 +19,12 @@ var _errors = require("../../common/utils/errors");
|
|
|
18
19
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
19
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; }
|
|
20
21
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
22
|
+
/**
|
|
23
|
+
* The value exposed through context. This differs from the provider's own props: internal callers
|
|
24
|
+
* may additionally supply a `LinkCreateFailureContext` identifying which operation failed, which is
|
|
25
|
+
* recorded in analytics but never forwarded to the consumer's `onFailure` prop.
|
|
26
|
+
*/
|
|
27
|
+
|
|
21
28
|
var LinkCreateCallbackContext = /*#__PURE__*/_react.default.createContext({});
|
|
22
29
|
var LinkCreateCallbackProvider = exports.LinkCreateCallbackProvider = function LinkCreateCallbackProvider(_ref) {
|
|
23
30
|
var children = _ref.children,
|
|
@@ -67,13 +74,20 @@ var LinkCreateCallbackProvider = exports.LinkCreateCallbackProvider = function L
|
|
|
67
74
|
var handleFailure = (0, _react.useMemo)(function () {
|
|
68
75
|
return {
|
|
69
76
|
onFailure: function () {
|
|
70
|
-
var _onFailure2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(error) {
|
|
77
|
+
var _onFailure2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(error, context) {
|
|
78
|
+
var _context$operation;
|
|
79
|
+
var _getNetworkFields, status, traceId;
|
|
71
80
|
return _regenerator.default.wrap(function (_context2) {
|
|
72
81
|
while (1) switch (_context2.prev = _context2.next) {
|
|
73
82
|
case 0:
|
|
74
|
-
|
|
83
|
+
_getNetworkFields = (0, _errors.getNetworkFields)(error), status = _getNetworkFields.status, traceId = _getNetworkFields.traceId;
|
|
84
|
+
createAnalyticsEvent((0, _analytics.default)('track.object.createFailed.linkCreate', _objectSpread({
|
|
75
85
|
failureType: (0, _errors.getErrorType)(error)
|
|
76
|
-
}
|
|
86
|
+
}, (0, _fg.fg)('platform_link_create_event_tracking') ? {
|
|
87
|
+
operation: (_context$operation = context === null || context === void 0 ? void 0 : context.operation) !== null && _context$operation !== void 0 ? _context$operation : null,
|
|
88
|
+
status: status,
|
|
89
|
+
traceId: traceId
|
|
90
|
+
} : {}))).fire(_constants.ANALYTICS_CHANNEL);
|
|
77
91
|
experience === null || experience === void 0 || experience.failure(error);
|
|
78
92
|
_onFailure && _onFailure(error);
|
|
79
93
|
case 1:
|
|
@@ -82,7 +96,7 @@ var LinkCreateCallbackProvider = exports.LinkCreateCallbackProvider = function L
|
|
|
82
96
|
}
|
|
83
97
|
}, _callee2);
|
|
84
98
|
}));
|
|
85
|
-
function onFailure(_x2) {
|
|
99
|
+
function onFailure(_x2, _x3) {
|
|
86
100
|
return _onFailure2.apply(this, arguments);
|
|
87
101
|
}
|
|
88
102
|
return onFailure;
|
|
@@ -15,8 +15,6 @@ var _analytics = _interopRequireDefault(require("../../../../common/utils/analyt
|
|
|
15
15
|
var _main = require("../../../../controllers/form-context/main");
|
|
16
16
|
var _formSpy = require("../../form-spy");
|
|
17
17
|
var _messages = require("./messages");
|
|
18
|
-
// eslint-disable-next-line @atlassian/tangerine/import/no-parent-imports
|
|
19
|
-
|
|
20
18
|
var EditButton = exports.EditButton = function EditButton() {
|
|
21
19
|
var intl = (0, _reactIntl.useIntl)();
|
|
22
20
|
var _useAnalyticsEvents = (0, _analyticsNext.useAnalyticsEvents)(),
|
|
@@ -14,10 +14,6 @@ var _constants = require("../../../../common/constants");
|
|
|
14
14
|
var _analytics = _interopRequireDefault(require("../../../../common/utils/analytics/analytics.codegen"));
|
|
15
15
|
var _formSpy = require("../../form-spy");
|
|
16
16
|
var _messages = require("../messages");
|
|
17
|
-
// eslint-disable-next-line @atlassian/tangerine/import/no-parent-imports
|
|
18
|
-
|
|
19
|
-
// eslint-disable-next-line @atlassian/tangerine/import/no-parent-imports
|
|
20
|
-
|
|
21
17
|
var SubmitButton = exports.SubmitButton = function SubmitButton() {
|
|
22
18
|
var intl = (0, _reactIntl.useIntl)();
|
|
23
19
|
var _useAnalyticsEvents = (0, _analyticsNext.useAnalyticsEvents)(),
|
|
@@ -10,7 +10,7 @@ export const CREATE_FORM_MIN_HEIGHT_IN_PX = '200';
|
|
|
10
10
|
export const LINK_CREATE_FORM_POST_CREATE_FIELD = '__post_create__';
|
|
11
11
|
export const PACKAGE_DATA = {
|
|
12
12
|
packageName: "@atlaskit/link-create" || '',
|
|
13
|
-
packageVersion: "6.3.
|
|
13
|
+
packageVersion: "6.3.6" || '',
|
|
14
14
|
component: COMPONENT_NAME,
|
|
15
15
|
componentName: COMPONENT_NAME
|
|
16
16
|
};
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Generates Typescript types for analytics events from analytics.spec.yaml
|
|
5
5
|
*
|
|
6
|
-
* @codegen <<SignedSource::
|
|
6
|
+
* @codegen <<SignedSource::ab46b9594ace5e515376a9aa203f040c>>
|
|
7
7
|
* @codegenCommand yarn workspace @atlaskit/link-create run codegen-analytics
|
|
8
8
|
*/
|
|
9
9
|
|
|
@@ -1,9 +1,17 @@
|
|
|
1
1
|
import React, { useContext, useMemo } from 'react';
|
|
2
2
|
import { useAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
3
|
+
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
3
4
|
import { ANALYTICS_CHANNEL } from '../../common/constants';
|
|
4
5
|
import { useExperience } from '../../common/ui/experience-tracker';
|
|
5
6
|
import createEventPayload from '../../common/utils/analytics/analytics.codegen';
|
|
6
|
-
import { getErrorType } from '../../common/utils/errors';
|
|
7
|
+
import { getErrorType, getNetworkFields } from '../../common/utils/errors';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* The value exposed through context. This differs from the provider's own props: internal callers
|
|
11
|
+
* may additionally supply a `LinkCreateFailureContext` identifying which operation failed, which is
|
|
12
|
+
* recorded in analytics but never forwarded to the consumer's `onFailure` prop.
|
|
13
|
+
*/
|
|
14
|
+
|
|
7
15
|
const LinkCreateCallbackContext = /*#__PURE__*/React.createContext({});
|
|
8
16
|
const LinkCreateCallbackProvider = ({
|
|
9
17
|
children,
|
|
@@ -36,9 +44,19 @@ const LinkCreateCallbackProvider = ({
|
|
|
36
44
|
}
|
|
37
45
|
}), [createAnalyticsEvent, onCreate, experience]);
|
|
38
46
|
const handleFailure = useMemo(() => ({
|
|
39
|
-
onFailure: async error => {
|
|
47
|
+
onFailure: async (error, context) => {
|
|
48
|
+
var _context$operation;
|
|
49
|
+
const {
|
|
50
|
+
status,
|
|
51
|
+
traceId
|
|
52
|
+
} = getNetworkFields(error);
|
|
40
53
|
createAnalyticsEvent(createEventPayload('track.object.createFailed.linkCreate', {
|
|
41
|
-
failureType: getErrorType(error)
|
|
54
|
+
failureType: getErrorType(error),
|
|
55
|
+
...(fg('platform_link_create_event_tracking') ? {
|
|
56
|
+
operation: (_context$operation = context === null || context === void 0 ? void 0 : context.operation) !== null && _context$operation !== void 0 ? _context$operation : null,
|
|
57
|
+
status,
|
|
58
|
+
traceId
|
|
59
|
+
} : {})
|
|
42
60
|
})).fire(ANALYTICS_CHANNEL);
|
|
43
61
|
experience === null || experience === void 0 ? void 0 : experience.failure(error);
|
|
44
62
|
onFailure && onFailure(error);
|
|
@@ -6,7 +6,6 @@ import LoadingButton from '@atlaskit/button/loading-button';
|
|
|
6
6
|
import { ANALYTICS_CHANNEL, LINK_CREATE_FORM_POST_CREATE_FIELD } from '../../../../common/constants';
|
|
7
7
|
import createEventPayload from '../../../../common/utils/analytics/analytics.codegen';
|
|
8
8
|
import { useFormContext } from '../../../../controllers/form-context/main';
|
|
9
|
-
// eslint-disable-next-line @atlassian/tangerine/import/no-parent-imports
|
|
10
9
|
import { FormSpy } from '../../form-spy';
|
|
11
10
|
import { messages } from './messages';
|
|
12
11
|
export const EditButton = () => {
|
|
@@ -5,9 +5,7 @@ import { useAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
|
5
5
|
import LoadingButton from '@atlaskit/button/loading-button';
|
|
6
6
|
import { ANALYTICS_CHANNEL, LINK_CREATE_FORM_POST_CREATE_FIELD } from '../../../../common/constants';
|
|
7
7
|
import createEventPayload from '../../../../common/utils/analytics/analytics.codegen';
|
|
8
|
-
// eslint-disable-next-line @atlassian/tangerine/import/no-parent-imports
|
|
9
8
|
import { FormSpy } from '../../form-spy';
|
|
10
|
-
// eslint-disable-next-line @atlassian/tangerine/import/no-parent-imports
|
|
11
9
|
import { messages } from '../messages';
|
|
12
10
|
export const SubmitButton = () => {
|
|
13
11
|
const intl = useIntl();
|
|
@@ -10,7 +10,7 @@ export var CREATE_FORM_MIN_HEIGHT_IN_PX = '200';
|
|
|
10
10
|
export var LINK_CREATE_FORM_POST_CREATE_FIELD = '__post_create__';
|
|
11
11
|
export var PACKAGE_DATA = {
|
|
12
12
|
packageName: "@atlaskit/link-create" || '',
|
|
13
|
-
packageVersion: "6.3.
|
|
13
|
+
packageVersion: "6.3.6" || '',
|
|
14
14
|
component: COMPONENT_NAME,
|
|
15
15
|
componentName: COMPONENT_NAME
|
|
16
16
|
};
|
|
@@ -4,7 +4,7 @@ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
|
4
4
|
*
|
|
5
5
|
* Generates Typescript types for analytics events from analytics.spec.yaml
|
|
6
6
|
*
|
|
7
|
-
* @codegen <<SignedSource::
|
|
7
|
+
* @codegen <<SignedSource::ab46b9594ace5e515376a9aa203f040c>>
|
|
8
8
|
* @codegenCommand yarn workspace @atlaskit/link-create run codegen-analytics
|
|
9
9
|
*/
|
|
10
10
|
|
|
@@ -5,10 +5,18 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
5
5
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
6
6
|
import React, { useContext, useMemo } from 'react';
|
|
7
7
|
import { useAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
8
|
+
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
8
9
|
import { ANALYTICS_CHANNEL } from '../../common/constants';
|
|
9
10
|
import { useExperience } from '../../common/ui/experience-tracker';
|
|
10
11
|
import createEventPayload from '../../common/utils/analytics/analytics.codegen';
|
|
11
|
-
import { getErrorType } from '../../common/utils/errors';
|
|
12
|
+
import { getErrorType, getNetworkFields } from '../../common/utils/errors';
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* The value exposed through context. This differs from the provider's own props: internal callers
|
|
16
|
+
* may additionally supply a `LinkCreateFailureContext` identifying which operation failed, which is
|
|
17
|
+
* recorded in analytics but never forwarded to the consumer's `onFailure` prop.
|
|
18
|
+
*/
|
|
19
|
+
|
|
12
20
|
var LinkCreateCallbackContext = /*#__PURE__*/React.createContext({});
|
|
13
21
|
var LinkCreateCallbackProvider = function LinkCreateCallbackProvider(_ref) {
|
|
14
22
|
var children = _ref.children,
|
|
@@ -58,13 +66,20 @@ var LinkCreateCallbackProvider = function LinkCreateCallbackProvider(_ref) {
|
|
|
58
66
|
var handleFailure = useMemo(function () {
|
|
59
67
|
return {
|
|
60
68
|
onFailure: function () {
|
|
61
|
-
var _onFailure2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(error) {
|
|
69
|
+
var _onFailure2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(error, context) {
|
|
70
|
+
var _context$operation;
|
|
71
|
+
var _getNetworkFields, status, traceId;
|
|
62
72
|
return _regeneratorRuntime.wrap(function (_context2) {
|
|
63
73
|
while (1) switch (_context2.prev = _context2.next) {
|
|
64
74
|
case 0:
|
|
65
|
-
|
|
75
|
+
_getNetworkFields = getNetworkFields(error), status = _getNetworkFields.status, traceId = _getNetworkFields.traceId;
|
|
76
|
+
createAnalyticsEvent(createEventPayload('track.object.createFailed.linkCreate', _objectSpread({
|
|
66
77
|
failureType: getErrorType(error)
|
|
67
|
-
}
|
|
78
|
+
}, fg('platform_link_create_event_tracking') ? {
|
|
79
|
+
operation: (_context$operation = context === null || context === void 0 ? void 0 : context.operation) !== null && _context$operation !== void 0 ? _context$operation : null,
|
|
80
|
+
status: status,
|
|
81
|
+
traceId: traceId
|
|
82
|
+
} : {}))).fire(ANALYTICS_CHANNEL);
|
|
68
83
|
experience === null || experience === void 0 || experience.failure(error);
|
|
69
84
|
_onFailure && _onFailure(error);
|
|
70
85
|
case 1:
|
|
@@ -73,7 +88,7 @@ var LinkCreateCallbackProvider = function LinkCreateCallbackProvider(_ref) {
|
|
|
73
88
|
}
|
|
74
89
|
}, _callee2);
|
|
75
90
|
}));
|
|
76
|
-
function onFailure(_x2) {
|
|
91
|
+
function onFailure(_x2, _x3) {
|
|
77
92
|
return _onFailure2.apply(this, arguments);
|
|
78
93
|
}
|
|
79
94
|
return onFailure;
|
|
@@ -6,7 +6,6 @@ import LoadingButton from '@atlaskit/button/loading-button';
|
|
|
6
6
|
import { ANALYTICS_CHANNEL, LINK_CREATE_FORM_POST_CREATE_FIELD } from '../../../../common/constants';
|
|
7
7
|
import createEventPayload from '../../../../common/utils/analytics/analytics.codegen';
|
|
8
8
|
import { useFormContext } from '../../../../controllers/form-context/main';
|
|
9
|
-
// eslint-disable-next-line @atlassian/tangerine/import/no-parent-imports
|
|
10
9
|
import { FormSpy } from '../../form-spy';
|
|
11
10
|
import { messages } from './messages';
|
|
12
11
|
export var EditButton = function EditButton() {
|
|
@@ -5,9 +5,7 @@ import { useAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
|
5
5
|
import LoadingButton from '@atlaskit/button/loading-button';
|
|
6
6
|
import { ANALYTICS_CHANNEL, LINK_CREATE_FORM_POST_CREATE_FIELD } from '../../../../common/constants';
|
|
7
7
|
import createEventPayload from '../../../../common/utils/analytics/analytics.codegen';
|
|
8
|
-
// eslint-disable-next-line @atlassian/tangerine/import/no-parent-imports
|
|
9
8
|
import { FormSpy } from '../../form-spy';
|
|
10
|
-
// eslint-disable-next-line @atlassian/tangerine/import/no-parent-imports
|
|
11
9
|
import { messages } from '../messages';
|
|
12
10
|
export var SubmitButton = function SubmitButton() {
|
|
13
11
|
var intl = useIntl();
|
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
import { type ReactNode } from 'react';
|
|
2
2
|
import { type ModalDialogProps } from '@atlaskit/modal-dialog';
|
|
3
|
+
/**
|
|
4
|
+
* Identifies which Link Create operation failed.
|
|
5
|
+
*
|
|
6
|
+
* This is a controlled vocabulary used for analytics only. It must never contain
|
|
7
|
+
* user-generated content, URLs, or tenant identifiers.
|
|
8
|
+
*/
|
|
9
|
+
export type LinkCreateOperation = 'fetch-space' | 'fetch-page' | 'load-default-values' | 'create-page' | 'create-whiteboard';
|
|
10
|
+
/** Additional, non-identifying context describing a Link Create failure. */
|
|
11
|
+
export type LinkCreateFailureContext = {
|
|
12
|
+
/** Which operation was being performed when the failure occurred. */
|
|
13
|
+
operation: LinkCreateOperation;
|
|
14
|
+
};
|
|
3
15
|
/** Map of field names to a list of validators for that field */
|
|
4
16
|
export type ValidatorMap = Record<string, Validator[]>;
|
|
5
17
|
export type Validator = {
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Generates Typescript types for analytics events from analytics.spec.yaml
|
|
5
5
|
*
|
|
6
|
-
* @codegen <<SignedSource::
|
|
6
|
+
* @codegen <<SignedSource::ab46b9594ace5e515376a9aa203f040c>>
|
|
7
7
|
* @codegenCommand yarn workspace @atlaskit/link-create run codegen-analytics
|
|
8
8
|
*/
|
|
9
9
|
export type PackageMetaDataType = {
|
|
@@ -37,6 +37,9 @@ export type ObjectCreatedLinkCreateAttributesType = {
|
|
|
37
37
|
};
|
|
38
38
|
export type ObjectCreateFailedLinkCreateAttributesType = {
|
|
39
39
|
failureType: string;
|
|
40
|
+
operation?: string | null;
|
|
41
|
+
status?: number | null;
|
|
42
|
+
traceId?: string | null;
|
|
40
43
|
};
|
|
41
44
|
export type LinkCreateExperienceFailedAttributesType = {
|
|
42
45
|
errorType?: string | null;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { type PropsWithChildren } from 'react';
|
|
2
|
-
import { type CreatePayload } from '../../common/types';
|
|
2
|
+
import { type CreatePayload, type LinkCreateFailureContext } from '../../common/types';
|
|
3
3
|
interface LinkCreateCallbackProviderProps {
|
|
4
4
|
/**
|
|
5
5
|
* This callback for when the resource has been successfully created.
|
|
@@ -14,6 +14,14 @@ interface LinkCreateCallbackProviderProps {
|
|
|
14
14
|
*/
|
|
15
15
|
onCancel?: () => void;
|
|
16
16
|
}
|
|
17
|
+
/**
|
|
18
|
+
* The value exposed through context. This differs from the provider's own props: internal callers
|
|
19
|
+
* may additionally supply a `LinkCreateFailureContext` identifying which operation failed, which is
|
|
20
|
+
* recorded in analytics but never forwarded to the consumer's `onFailure` prop.
|
|
21
|
+
*/
|
|
22
|
+
type LinkCreateCallbackContextValue = Omit<LinkCreateCallbackProviderProps, 'onFailure'> & {
|
|
23
|
+
onFailure?: (error: unknown, context?: LinkCreateFailureContext) => void;
|
|
24
|
+
};
|
|
17
25
|
declare const LinkCreateCallbackProvider: ({ children, onCreate, onFailure, onCancel, }: PropsWithChildren<LinkCreateCallbackProviderProps>) => React.JSX.Element;
|
|
18
|
-
declare const useLinkCreateCallback: () =>
|
|
26
|
+
declare const useLinkCreateCallback: () => LinkCreateCallbackContextValue;
|
|
19
27
|
export { LinkCreateCallbackProvider, useLinkCreateCallback };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/link-create",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.4.0",
|
|
4
4
|
"description": "The driver component of meta creation flow",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -34,15 +34,15 @@
|
|
|
34
34
|
"@atlaskit/afm-i18n-platform-linking-platform-link-create": "2.201.0",
|
|
35
35
|
"@atlaskit/analytics-next": "^12.3.0",
|
|
36
36
|
"@atlaskit/atlassian-context": "^1.1.0",
|
|
37
|
-
"@atlaskit/button": "^25.
|
|
37
|
+
"@atlaskit/button": "^25.1.0",
|
|
38
38
|
"@atlaskit/css": "^1.0.0",
|
|
39
39
|
"@atlaskit/empty-state": "^12.0.0",
|
|
40
|
-
"@atlaskit/form": "^
|
|
41
|
-
"@atlaskit/icon": "^37.
|
|
40
|
+
"@atlaskit/form": "^17.0.0",
|
|
41
|
+
"@atlaskit/icon": "^37.4.0",
|
|
42
42
|
"@atlaskit/icon-file-type": "^8.1.0",
|
|
43
43
|
"@atlaskit/intl-messages-provider": "^4.2.0",
|
|
44
44
|
"@atlaskit/link": "^5.0.0",
|
|
45
|
-
"@atlaskit/linking-common": "^11.
|
|
45
|
+
"@atlaskit/linking-common": "^11.2.0",
|
|
46
46
|
"@atlaskit/modal-dialog": "^16.3.0",
|
|
47
47
|
"@atlaskit/object": "^2.2.0",
|
|
48
48
|
"@atlaskit/platform-feature-flags": "^2.1.0",
|
|
@@ -53,9 +53,9 @@
|
|
|
53
53
|
"@atlaskit/spinner": "^20.1.0",
|
|
54
54
|
"@atlaskit/textfield": "^10.0.0",
|
|
55
55
|
"@atlaskit/theme": "^28.0.0",
|
|
56
|
-
"@atlaskit/tokens": "^16.
|
|
56
|
+
"@atlaskit/tokens": "^16.7.0",
|
|
57
57
|
"@babel/runtime": "^7.0.0",
|
|
58
|
-
"@compiled/react": "^1.0.
|
|
58
|
+
"@compiled/react": "^1.0.2",
|
|
59
59
|
"debounce-promise": "^3.1.2",
|
|
60
60
|
"final-form": "^4.20.3",
|
|
61
61
|
"react-final-form": "^6.5.3"
|
|
@@ -71,7 +71,7 @@
|
|
|
71
71
|
"@atlaskit/drawer": "^14.0.0",
|
|
72
72
|
"@atlaskit/link-test-helpers": "^11.0.0",
|
|
73
73
|
"@atlaskit/popup": "^6.0.0",
|
|
74
|
-
"@atlassian/a11y-jest-testing": "^0.
|
|
74
|
+
"@atlassian/a11y-jest-testing": "^0.16.0",
|
|
75
75
|
"@atlassian/feature-flags-test-utils": "^1.2.0",
|
|
76
76
|
"@atlassian/structured-docs-types": "workspace:^",
|
|
77
77
|
"@testing-library/react": "^16.3.0",
|
|
@@ -122,6 +122,10 @@
|
|
|
122
122
|
]
|
|
123
123
|
}
|
|
124
124
|
},
|
|
125
|
-
"platform-feature-flags": {
|
|
125
|
+
"platform-feature-flags": {
|
|
126
|
+
"platform_link_create_event_tracking": {
|
|
127
|
+
"type": "boolean"
|
|
128
|
+
}
|
|
129
|
+
},
|
|
126
130
|
"compassUnitTestMetricSourceId": "ari:cloud:compass:a436116f-02ce-4520-8fbb-7301462a1674:metric-source/c5751cc6-3513-4070-9deb-af31e86aed34/5ebc0bfb-9b6d-4ec0-adbe-e4d5e88ace44"
|
|
127
131
|
}
|
package/link-create.docs.tsx
DELETED
|
@@ -1,351 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Testing structured MCP docs for review — ignore this file.
|
|
3
|
-
* Contact #dst-structured-content in Slack with questions.
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
import path from 'path';
|
|
7
|
-
|
|
8
|
-
import type { StructuredContentSource } from '@atlassian/structured-docs-types/types';
|
|
9
|
-
|
|
10
|
-
import packageJson from './package.json';
|
|
11
|
-
|
|
12
|
-
const packagePath = path.resolve(__dirname);
|
|
13
|
-
|
|
14
|
-
const documentation: StructuredContentSource = {
|
|
15
|
-
components: [
|
|
16
|
-
{
|
|
17
|
-
name: 'LinkCreate',
|
|
18
|
-
description:
|
|
19
|
-
'The driver component of the link creation (meta create) flow. Renders a modal with plugin tabs (e.g. Jira issue, Confluence page); each plugin provides a form that returns a URL and metadata on success. Use for "create and link" experiences.',
|
|
20
|
-
status: 'general-availability',
|
|
21
|
-
import: {
|
|
22
|
-
name: 'LinkCreate',
|
|
23
|
-
package: '@atlaskit/link-create',
|
|
24
|
-
type: 'default',
|
|
25
|
-
packagePath,
|
|
26
|
-
packageJson,
|
|
27
|
-
},
|
|
28
|
-
usageGuidelines: [
|
|
29
|
-
'Use when the user should create a new resource (issue, page, etc.) and insert its link in one flow. Supply plugins (e.g. from link-create-jira, link-create-confluence); control visibility with active/onCancel.',
|
|
30
|
-
],
|
|
31
|
-
contentGuidelines: [],
|
|
32
|
-
accessibilityGuidelines: [
|
|
33
|
-
'Ensure the modal has an accessible title and focus is trapped; ensure plugin forms have proper labels and error messages announced.',
|
|
34
|
-
],
|
|
35
|
-
keywords: ['link-create', 'create', 'modal', 'meta create', 'plugins'],
|
|
36
|
-
categories: ['linking', 'forms', 'interaction'],
|
|
37
|
-
examples: [],
|
|
38
|
-
},
|
|
39
|
-
{
|
|
40
|
-
name: 'InlineCreate',
|
|
41
|
-
description:
|
|
42
|
-
'Inline (non-modal) link creation experience. Renders plugin forms inline so users can create a resource and get a link without opening a modal.',
|
|
43
|
-
status: 'general-availability',
|
|
44
|
-
import: {
|
|
45
|
-
name: 'InlineCreate',
|
|
46
|
-
package: '@atlaskit/link-create',
|
|
47
|
-
type: 'named',
|
|
48
|
-
packagePath,
|
|
49
|
-
packageJson,
|
|
50
|
-
},
|
|
51
|
-
usageGuidelines: [
|
|
52
|
-
'Use when you want "create and link" inline (e.g. in a dropdown or panel) instead of a modal. Supply the same plugin structure as LinkCreate.',
|
|
53
|
-
],
|
|
54
|
-
contentGuidelines: [],
|
|
55
|
-
accessibilityGuidelines: [
|
|
56
|
-
'Ensure the inline form has an accessible name and that focus moves logically through fields.',
|
|
57
|
-
],
|
|
58
|
-
keywords: ['link-create', 'inline', 'create', 'plugins'],
|
|
59
|
-
categories: ['linking', 'forms', 'interaction'],
|
|
60
|
-
examples: [],
|
|
61
|
-
},
|
|
62
|
-
{
|
|
63
|
-
name: 'CreateForm',
|
|
64
|
-
description:
|
|
65
|
-
'Form container for a single link-create plugin. Renders the plugin form UI and handles submit, validation, and success callback. Used inside plugin form implementations.',
|
|
66
|
-
status: 'general-availability',
|
|
67
|
-
import: {
|
|
68
|
-
name: 'CreateForm',
|
|
69
|
-
package: '@atlaskit/link-create',
|
|
70
|
-
type: 'named',
|
|
71
|
-
packagePath,
|
|
72
|
-
packageJson,
|
|
73
|
-
},
|
|
74
|
-
usageGuidelines: [
|
|
75
|
-
'Use when building a custom LinkCreatePlugin form; wrap your fields in CreateForm and use onSubmit to return CreatePayload on success.',
|
|
76
|
-
],
|
|
77
|
-
contentGuidelines: [],
|
|
78
|
-
accessibilityGuidelines: [],
|
|
79
|
-
keywords: ['link-create', 'form', 'CreateForm', 'plugin'],
|
|
80
|
-
categories: ['linking', 'forms'],
|
|
81
|
-
examples: [],
|
|
82
|
-
},
|
|
83
|
-
{
|
|
84
|
-
name: 'CreateFormLoader',
|
|
85
|
-
description:
|
|
86
|
-
'Loader wrapper for CreateForm that shows a loading state until form data or context is ready.',
|
|
87
|
-
status: 'general-availability',
|
|
88
|
-
import: {
|
|
89
|
-
name: 'CreateFormLoader',
|
|
90
|
-
package: '@atlaskit/link-create',
|
|
91
|
-
type: 'named',
|
|
92
|
-
packagePath,
|
|
93
|
-
packageJson,
|
|
94
|
-
},
|
|
95
|
-
usageGuidelines: [
|
|
96
|
-
'Use when the create form depends on async data (e.g. site list, field config); show loading until ready then render CreateForm.',
|
|
97
|
-
],
|
|
98
|
-
contentGuidelines: [],
|
|
99
|
-
accessibilityGuidelines: [
|
|
100
|
-
'Ensure loading state is announced (e.g. aria-busy or live region).',
|
|
101
|
-
],
|
|
102
|
-
keywords: ['link-create', 'form', 'loader', 'CreateFormLoader'],
|
|
103
|
-
categories: ['linking', 'forms'],
|
|
104
|
-
examples: [],
|
|
105
|
-
},
|
|
106
|
-
{
|
|
107
|
-
name: 'FormSpy',
|
|
108
|
-
description:
|
|
109
|
-
'Component that subscribes to form state (values, errors, submitting) from react-final-form. Used to build custom UI that reacts to form state.',
|
|
110
|
-
status: 'general-availability',
|
|
111
|
-
import: {
|
|
112
|
-
name: 'FormSpy',
|
|
113
|
-
package: '@atlaskit/link-create',
|
|
114
|
-
type: 'named',
|
|
115
|
-
packagePath,
|
|
116
|
-
packageJson,
|
|
117
|
-
},
|
|
118
|
-
usageGuidelines: [
|
|
119
|
-
'Use when you need to read or react to create form state (e.g. to enable/disable a submit button or show a summary) without controlling the form.',
|
|
120
|
-
],
|
|
121
|
-
contentGuidelines: [],
|
|
122
|
-
accessibilityGuidelines: [],
|
|
123
|
-
keywords: ['link-create', 'form', 'FormSpy', 'react-final-form'],
|
|
124
|
-
categories: ['linking', 'forms'],
|
|
125
|
-
examples: [],
|
|
126
|
-
},
|
|
127
|
-
{
|
|
128
|
-
name: 'AsyncSelect',
|
|
129
|
-
description:
|
|
130
|
-
'Async-capable select component used in link-create forms for fields that load options from an API (e.g. project, type).',
|
|
131
|
-
status: 'general-availability',
|
|
132
|
-
import: {
|
|
133
|
-
name: 'AsyncSelect',
|
|
134
|
-
package: '@atlaskit/link-create',
|
|
135
|
-
type: 'named',
|
|
136
|
-
packagePath,
|
|
137
|
-
packageJson,
|
|
138
|
-
},
|
|
139
|
-
usageGuidelines: [
|
|
140
|
-
'Use inside a create form when the dropdown options are loaded asynchronously (e.g. Jira projects, issue types).',
|
|
141
|
-
],
|
|
142
|
-
contentGuidelines: [],
|
|
143
|
-
accessibilityGuidelines: [
|
|
144
|
-
'Ensure the select has a label and that options are announced to screen readers.',
|
|
145
|
-
],
|
|
146
|
-
keywords: ['link-create', 'select', 'async', 'form'],
|
|
147
|
-
categories: ['linking', 'forms'],
|
|
148
|
-
examples: [],
|
|
149
|
-
},
|
|
150
|
-
{
|
|
151
|
-
name: 'Select',
|
|
152
|
-
description: 'Select component for link-create forms. Use for static or sync option lists.',
|
|
153
|
-
status: 'general-availability',
|
|
154
|
-
import: {
|
|
155
|
-
name: 'Select',
|
|
156
|
-
package: '@atlaskit/link-create',
|
|
157
|
-
type: 'named',
|
|
158
|
-
packagePath,
|
|
159
|
-
packageJson,
|
|
160
|
-
},
|
|
161
|
-
usageGuidelines: [
|
|
162
|
-
'Use inside a create form for dropdowns with static or synchronously available options.',
|
|
163
|
-
],
|
|
164
|
-
contentGuidelines: [],
|
|
165
|
-
accessibilityGuidelines: ['Ensure the select has an accessible label.'],
|
|
166
|
-
keywords: ['link-create', 'select', 'form'],
|
|
167
|
-
categories: ['linking', 'forms'],
|
|
168
|
-
examples: [],
|
|
169
|
-
},
|
|
170
|
-
{
|
|
171
|
-
name: 'SiteSelect',
|
|
172
|
-
description:
|
|
173
|
-
'Site/product picker used in link-create forms when the user must choose a site or product (e.g. Jira site, Confluence space) before other fields.',
|
|
174
|
-
status: 'general-availability',
|
|
175
|
-
import: {
|
|
176
|
-
name: 'SiteSelect',
|
|
177
|
-
package: '@atlaskit/link-create',
|
|
178
|
-
type: 'named',
|
|
179
|
-
packagePath,
|
|
180
|
-
packageJson,
|
|
181
|
-
},
|
|
182
|
-
usageGuidelines: [
|
|
183
|
-
'Use when the create flow requires picking a site or product first; follow with form fields that depend on that selection.',
|
|
184
|
-
],
|
|
185
|
-
contentGuidelines: [],
|
|
186
|
-
accessibilityGuidelines: [
|
|
187
|
-
'Ensure the site picker has an accessible name and that selected site is announced.',
|
|
188
|
-
],
|
|
189
|
-
keywords: ['link-create', 'site', 'select', 'picker', 'form'],
|
|
190
|
-
categories: ['linking', 'forms'],
|
|
191
|
-
examples: [],
|
|
192
|
-
},
|
|
193
|
-
{
|
|
194
|
-
name: 'TextField',
|
|
195
|
-
description:
|
|
196
|
-
'Text input component for link-create forms. Wired for validation and final-form.',
|
|
197
|
-
status: 'general-availability',
|
|
198
|
-
import: {
|
|
199
|
-
name: 'TextField',
|
|
200
|
-
package: '@atlaskit/link-create',
|
|
201
|
-
type: 'named',
|
|
202
|
-
packagePath,
|
|
203
|
-
packageJson,
|
|
204
|
-
},
|
|
205
|
-
usageGuidelines: [
|
|
206
|
-
'Use inside a create form for single-line text fields (e.g. title, summary).',
|
|
207
|
-
],
|
|
208
|
-
contentGuidelines: [],
|
|
209
|
-
accessibilityGuidelines: [
|
|
210
|
-
'Ensure each field has a visible or aria-label and that validation errors are announced.',
|
|
211
|
-
],
|
|
212
|
-
keywords: ['link-create', 'textfield', 'input', 'form'],
|
|
213
|
-
categories: ['linking', 'forms'],
|
|
214
|
-
examples: [],
|
|
215
|
-
},
|
|
216
|
-
{
|
|
217
|
-
name: 'UserPicker',
|
|
218
|
-
description:
|
|
219
|
-
'User picker component for link-create forms. Used for assignee, reporter, or other user fields.',
|
|
220
|
-
status: 'general-availability',
|
|
221
|
-
import: {
|
|
222
|
-
name: 'UserPicker',
|
|
223
|
-
package: '@atlaskit/link-create',
|
|
224
|
-
type: 'named',
|
|
225
|
-
packagePath,
|
|
226
|
-
packageJson,
|
|
227
|
-
},
|
|
228
|
-
usageGuidelines: [
|
|
229
|
-
'Use inside a create form when the user must select a person (e.g. assignee, creator).',
|
|
230
|
-
],
|
|
231
|
-
contentGuidelines: [],
|
|
232
|
-
accessibilityGuidelines: [
|
|
233
|
-
'Ensure the picker has an accessible name and that the selected user is announced.',
|
|
234
|
-
],
|
|
235
|
-
keywords: ['link-create', 'user', 'picker', 'form'],
|
|
236
|
-
categories: ['linking', 'forms'],
|
|
237
|
-
examples: [],
|
|
238
|
-
},
|
|
239
|
-
{
|
|
240
|
-
name: 'LinkCreateCallbackProvider',
|
|
241
|
-
description:
|
|
242
|
-
'Context provider that supplies a callback (e.g. on success) to link-create. Used so plugins or parents can react to create completion.',
|
|
243
|
-
status: 'general-availability',
|
|
244
|
-
import: {
|
|
245
|
-
name: 'LinkCreateCallbackProvider',
|
|
246
|
-
package: '@atlaskit/link-create',
|
|
247
|
-
type: 'named',
|
|
248
|
-
packagePath,
|
|
249
|
-
packageJson,
|
|
250
|
-
},
|
|
251
|
-
usageGuidelines: [
|
|
252
|
-
'Wrap LinkCreate or InlineCreate when you need to run custom logic (e.g. insert link, close picker) when create succeeds; consume with useLinkCreateCallback.',
|
|
253
|
-
],
|
|
254
|
-
contentGuidelines: [],
|
|
255
|
-
accessibilityGuidelines: [],
|
|
256
|
-
keywords: ['link-create', 'callback', 'context', 'provider'],
|
|
257
|
-
categories: ['linking', 'forms'],
|
|
258
|
-
examples: [],
|
|
259
|
-
},
|
|
260
|
-
{
|
|
261
|
-
name: 'LinkCreateExitWarningProvider',
|
|
262
|
-
description:
|
|
263
|
-
'Provider that enables an exit-confirmation when the user tries to leave the create flow with unsaved changes. Uses ExitWarningModalProvider internally.',
|
|
264
|
-
status: 'general-availability',
|
|
265
|
-
import: {
|
|
266
|
-
name: 'LinkCreateExitWarningProvider',
|
|
267
|
-
package: '@atlaskit/link-create',
|
|
268
|
-
type: 'named',
|
|
269
|
-
packagePath,
|
|
270
|
-
packageJson,
|
|
271
|
-
},
|
|
272
|
-
usageGuidelines: [
|
|
273
|
-
'Wrap the create flow when you want to warn users before closing or navigating away with unsaved form data.',
|
|
274
|
-
],
|
|
275
|
-
contentGuidelines: [],
|
|
276
|
-
accessibilityGuidelines: [
|
|
277
|
-
'Ensure the exit warning modal is focusable and has an accessible title and actions.',
|
|
278
|
-
],
|
|
279
|
-
keywords: ['link-create', 'exit', 'warning', 'provider', 'unsaved'],
|
|
280
|
-
categories: ['linking', 'forms', 'interaction'],
|
|
281
|
-
examples: [],
|
|
282
|
-
},
|
|
283
|
-
{
|
|
284
|
-
name: 'CreateField',
|
|
285
|
-
description:
|
|
286
|
-
'Controller component that connects a form field to the create form state (name, validation, value). Use to build custom fields that participate in CreateForm.',
|
|
287
|
-
status: 'general-availability',
|
|
288
|
-
import: {
|
|
289
|
-
name: 'CreateField',
|
|
290
|
-
package: '@atlaskit/link-create',
|
|
291
|
-
type: 'named',
|
|
292
|
-
packagePath,
|
|
293
|
-
packageJson,
|
|
294
|
-
},
|
|
295
|
-
usageGuidelines: [
|
|
296
|
-
'Use when building a custom form field (e.g. custom select, date picker) that must be part of the create form validation and submit payload.',
|
|
297
|
-
],
|
|
298
|
-
contentGuidelines: [],
|
|
299
|
-
accessibilityGuidelines: [
|
|
300
|
-
'Ensure the rendered control has an accessible name and that validation errors are associated (e.g. aria-describedby).',
|
|
301
|
-
],
|
|
302
|
-
keywords: ['link-create', 'form', 'field', 'CreateField'],
|
|
303
|
-
categories: ['linking', 'forms'],
|
|
304
|
-
examples: [],
|
|
305
|
-
},
|
|
306
|
-
],
|
|
307
|
-
hooks: [
|
|
308
|
-
{
|
|
309
|
-
name: 'useLinkCreateCallback',
|
|
310
|
-
description:
|
|
311
|
-
'Hook that returns the link-create callback from LinkCreateCallbackProvider. Use to trigger or react to create success from child components.',
|
|
312
|
-
status: 'general-availability',
|
|
313
|
-
import: {
|
|
314
|
-
name: 'useLinkCreateCallback',
|
|
315
|
-
package: '@atlaskit/link-create',
|
|
316
|
-
type: 'named',
|
|
317
|
-
packagePath,
|
|
318
|
-
packageJson,
|
|
319
|
-
},
|
|
320
|
-
usageGuidelines: [
|
|
321
|
-
'Use inside a plugin or child of LinkCreateCallbackProvider when you need access to the create-success callback.',
|
|
322
|
-
],
|
|
323
|
-
accessibilityGuidelines: [],
|
|
324
|
-
keywords: ['link-create', 'hooks', 'callback', 'useLinkCreateCallback'],
|
|
325
|
-
categories: ['linking', 'forms'],
|
|
326
|
-
examples: [],
|
|
327
|
-
},
|
|
328
|
-
{
|
|
329
|
-
name: 'useWithExitWarning',
|
|
330
|
-
description:
|
|
331
|
-
'Hook that wires the current form or flow into the exit-warning behavior. Use when building custom create UI that should trigger the exit warning.',
|
|
332
|
-
status: 'general-availability',
|
|
333
|
-
import: {
|
|
334
|
-
name: 'useWithExitWarning',
|
|
335
|
-
package: '@atlaskit/link-create',
|
|
336
|
-
type: 'named',
|
|
337
|
-
packagePath,
|
|
338
|
-
packageJson,
|
|
339
|
-
},
|
|
340
|
-
usageGuidelines: [
|
|
341
|
-
'Use inside a component wrapped by LinkCreateExitWarningProvider when you need to register dirty state or trigger the exit warning modal.',
|
|
342
|
-
],
|
|
343
|
-
accessibilityGuidelines: [],
|
|
344
|
-
keywords: ['link-create', 'hooks', 'exit', 'warning', 'useWithExitWarning'],
|
|
345
|
-
categories: ['linking', 'forms'],
|
|
346
|
-
examples: [],
|
|
347
|
-
},
|
|
348
|
-
],
|
|
349
|
-
};
|
|
350
|
-
|
|
351
|
-
export default documentation;
|